react-text-forge 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(K,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("slate"),require("react"),require("slate-react"),require("slate-history"),require("react-color"),require("slate-docx-deserializer")):typeof define=="function"&&define.amd?define(["exports","slate","react","slate-react","slate-history","react-color","slate-docx-deserializer"],d):(K=typeof globalThis<"u"?globalThis:K||self,d(K.ReactTextForge={},K.Slate,K.React,K.SlateReact,K.SlateHistory,K.ReactColor,K.SlateDocxDeserializer))})(this,function(K,d,C,se,We,Ue,Ze){"use strict";/*!
|
|
2
2
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
5
5
|
* Released under the MIT License.
|
|
6
|
-
*/function ke(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ge(t){var e,r;return ke(t)===!1?!1:(e=t.constructor,e===void 0?!0:(r=e.prototype,!(ke(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function le(t){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(t)}function Ye(t,e){if(le(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ke(t){var e=Ye(t,"string");return le(e)==="symbol"?e:String(e)}function
|
|
7
|
-
The <text> hyperscript tag can only contain text content as children.`);return pe.delete(s),Object.assign(s,e),s}var lt=t=>(e,r,n)=>{var s=[],l;for(var c of n)d.Range.isRange(c)?l=c:s.push(c);var
|
|
6
|
+
*/function ke(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ge(t){var e,r;return ke(t)===!1?!1:(e=t.constructor,e===void 0?!0:(r=e.prototype,!(ke(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function le(t){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(t)}function Ye(t,e){if(le(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ke(t){var e=Ye(t,"string");return le(e)==="symbol"?e:String(e)}function oe(t,e,r){return e=Ke(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ce=new WeakMap,je=new WeakMap;class me{}class de extends me{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),oe(this,"offset",void 0),oe(this,"path",void 0);var{offset:r,path:n}=e;this.offset=r,this.path=n}}class fe extends me{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),oe(this,"offset",void 0),oe(this,"path",void 0);var{offset:r,path:n}=e;this.offset=r,this.path=n}}var Xe=(t,e)=>{var r=t.text.length;Ce.set(t,[r,e])},Je=t=>Ce.get(t),Qe=(t,e)=>{var r=t.text.length;je.set(t,[r,e])},et=t=>je.get(t);function Fe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fe(Object(r),!0).forEach(function(n){oe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var pe=new WeakSet,ge=t=>{var e=[],r=s=>{if(s!=null){var l=e[e.length-1];if(typeof s=="string"){var c={text:s};pe.add(c),s=c}if(d.Text.isText(s)){var a=s;d.Text.isText(l)&&pe.has(l)&&pe.has(a)&&d.Text.equals(l,a,{loose:!0})?l.text+=a.text:e.push(a)}else if(d.Element.isElement(s))e.push(s);else if(s instanceof me){var p=e[e.length-1];d.Text.isText(p)||(r(""),p=e[e.length-1]),s instanceof de?Xe(p,s):s instanceof fe&&Qe(p,s)}else throw new Error("Unexpected hyperscript child object: ".concat(s))}};for(var n of t.flat(1/0))r(n);return e};function tt(t,e,r){return new de(e)}function rt(t,e,r){return[new de(e),new fe(e)]}function Ee(t,e,r){return be(be({},e),{},{children:ge(r)})}function nt(t,e,r){return new fe(e)}function st(t,e,r){return ge(r)}function ot(t,e,r){var n=r.find(l=>l instanceof de),s=r.find(l=>l instanceof fe);if(!n||n.offset==null||n.path==null)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");if(!s||s.offset==null||s.path==null)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");return be({anchor:{offset:n.offset,path:n.path},focus:{offset:s.offset,path:s.path}},e)}function at(t,e,r){var n=ge(r);if(n.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");var[s]=n;if(s==null&&(s={text:""}),!d.Text.isText(s))throw new Error(`
|
|
7
|
+
The <text> hyperscript tag can only contain text content as children.`);return pe.delete(s),Object.assign(s,e),s}var lt=t=>(e,r,n)=>{var s=[],l;for(var c of n)d.Range.isRange(c)?l=c:s.push(c);var a=ge(s),p={},j=t();Object.assign(j,r),j.children=a;for(var[h,w]of d.Node.texts(j)){var g=Je(h),F=et(h);if(g!=null){var[_]=g;p.anchor={path:w,offset:_}}if(F!=null){var[N]=F;p.focus={path:w,offset:N}}}if(p.anchor&&!p.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");if(!p.anchor&&p.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");return l!=null?j.selection=l:d.Range.isRange(p)&&(j.selection=p),j};function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(r),!0).forEach(function(n){oe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var it={anchor:tt,cursor:rt,editor:lt(d.createEditor),element:Ee,focus:nt,fragment:st,selection:ot,text:at},ct=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{elements:r={}}=e,n=dt(r),s=ie(ie(ie({},it),n),e.creators),l=ut(s);return l},ut=t=>{var e=function(n,s){for(var l=arguments.length,c=new Array(l>2?l-2:0),a=2;a<l;a++)c[a-2]=arguments[a];var p=t[n];if(!p)throw new Error("No hyperscript creator found for tag: <".concat(n,">"));s==null&&(s={}),Ge(s)||(c=[s].concat(c),s={}),c=c.filter(h=>!!h).flat();var j=p(n,s,c);return j};return e},dt=t=>{var e={},r=function(){var l=t[n];if(typeof l!="object")throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(n,"> tag you passed: ").concat(l));e[n]=(c,a,p)=>Ee("element",ie(ie({},l),a),p)};for(var n in t)r();return e},P=ct();/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright (c) 2025 Jahylis
|
|
10
10
|
*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
24
24
|
*
|
|
25
25
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
26
|
-
*/const ft=t=>{const r=new DOMParser().parseFromString(t,"text/html"),n=l=>{if(l.nodeType===Node.TEXT_NODE)return l.textContent;if(l.nodeType!==Node.ELEMENT_NODE)return null;const c=Array.from(l.childNodes).map(n).flat().filter(Boolean),
|
|
26
|
+
*/const ft=t=>{const r=new DOMParser().parseFromString(t,"text/html"),n=l=>{if(l.nodeType===Node.TEXT_NODE)return l.textContent;if(l.nodeType!==Node.ELEMENT_NODE)return null;const c=Array.from(l.childNodes).map(n).flat().filter(Boolean),a={bold:l.querySelector("strong")!==null,italic:l.querySelector("em")!==null,underline:l.querySelector("u")!==null,strikethrough:l.querySelector("del")!==null,subscript:l.querySelector("sub")!==null,superscript:l.querySelector("sup")!==null,bgColor:l.style.backgroundColor||l.querySelector("mark")&&l.querySelector("mark").style.backgroundColor,color:l.style.color,fontSize:l.style.fontSize,fontFamily:l.style.fontFamily,href:l.nodeName==="A"?l.getAttribute("href"):null,target:l.nodeName==="A"?l.getAttribute("target"):null,rel:l.nodeName==="A"?l.getAttribute("rel"):null};switch(l.nodeName){case"P":return P("element",{type:"paragraph"},c);case"PRE":return P("element",{type:"code"},c);case"UL":return P("element",{type:"bullet-list"},c);case"OL":return P("element",{type:"numbered-list"},c);case"LI":return P("element",{type:"list-item"},c);case"H1":return P("element",{type:"h1"},c);case"H2":return P("element",{type:"h2"},c);case"BLOCKQUOTE":return P("element",{type:"blockquote"},c);case"IMG":return P("element",{type:"image",url:l.getAttribute("src")});case"TABLE":return P("element",{type:"table"},c);case"TR":return P("element",{type:"table-row"},c);case"TD":return P("element",{type:"table-cell"},c);case"A":return P("element",{type:"link",url:l.getAttribute("href")},c);default:return c.map(p=>typeof p=="string"?P("text",a,p):p)}};return Array.from(r.body.childNodes).map(n).flat().filter(Boolean)};/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright (c) 2025 Jahylis
|
|
29
29
|
*
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
43
43
|
*
|
|
44
44
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
45
|
-
*/const
|
|
45
|
+
*/const J=t=>t.map(e=>{if(d.Text.isText(e)){let r=e.text;const n=[];if(e.bold&&n.push(`<strong>${r}</strong>`),e.italic&&n.push(`<em>${r}</em>`),e.underline&&n.push(`<u>${r}</u>`),e.strikethrough&&n.push(`<del>${r}</del>`),e.subscript&&!e.superscript&&n.push(`<sub>${r}</sub>`),!e.subscript&&e.superscript&&n.push(`<sup>${r}</sup>`),e.bgColor&&n.push(`<mark style="background-color: ${e.bgColor}">${r}</mark>`),e.href){const l=e.color?` style="color: ${e.color}"`:"",c=e.target?` target="${e.target}"`:"",a=e.rel?` rel="${e.rel}"`:"";return`<a class="rtf" href="${e.href}"${c}${a}${l}>${n.length?n.join(""):r}</a>`}return`<span${` style="color: ${e.color}; font-size: ${e.fontSize}; font-family: ${e.fontFamily}"`}>${n.length>0?n.join(""):r}</span>`}return e.type==="paragraph"?`<p class="rtf">${J(e.children)}</p>`:e.type==="code"?`<pre class="rtf"><code>${J(e.children)}</code></pre>`:e.type==="bullet-list"?`<ul class="rtf">${J(e.children)}</ul>`:e.type==="numbered-list"?`<ol class="rtf">${J(e.children)}</ol>`:e.type==="list-item"?`<li class="rtf">${J(e.children)}</li>`:e.type==="h1"?`<h1 class="rtf">${J(e.children)}</h1>`:e.type==="h2"?`<h2 class="rtf">${J(e.children)}</h2>`:e.type==="blockquote"?`<blockquote class="rtf">${J(e.children)}</blockquote>`:e.type==="image"?`<img class="rtf" src="${e.url}" alt="" />`:e.type==="table"?`<table class="rtf"><tbody>${J(e.children)}</tbody></table>`:e.type==="table-row"?`<tr class="rtf">${J(e.children)}</tr>`:e.type==="table-cell"?`<td class="rtf">${J(e.children)}</td>`:e.type==="link"?`<a class="rtf" href="${e.url}">${J(e.children)}</a>`:""}).join("");var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var he={exports:{}},ce={};/**
|
|
46
46
|
* @license React
|
|
47
47
|
* react-jsx-runtime.production.js
|
|
48
48
|
*
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
*
|
|
51
51
|
* This source code is licensed under the MIT license found in the
|
|
52
52
|
* LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/var Ne;function gt(){if(Ne)return ce;Ne=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var
|
|
53
|
+
*/var Ne;function gt(){if(Ne)return ce;Ne=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var a in s)a!=="key"&&(l[a]=s[a])}else l=s;return s=l.ref,{$$typeof:t,type:n,key:c,ref:s!==void 0?s:null,props:l}}return ce.Fragment=e,ce.jsx=r,ce.jsxs=r,ce}var ue={};/**
|
|
54
54
|
* @license React
|
|
55
55
|
* react-jsx-runtime.development.js
|
|
56
56
|
*
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the MIT license found in the
|
|
60
60
|
* LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/var Ae;function ht(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&function(){function t(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===
|
|
61
|
+
*/var Ae;function ht(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&function(){function t(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===T?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case N:return"Fragment";case L:return"Profiler";case S:return"StrictMode";case v:return"Suspense";case y:return"SuspenseList";case x:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case _:return"Portal";case u:return(m.displayName||"Context")+".Provider";case i:return(m._context.displayName||"Context")+".Consumer";case b:var $=m.render;return m=m.displayName,m||(m=$.displayName||$.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case E:return $=m.displayName||null,$!==null?$:t(m.type)||"Memo";case f:$=m._payload,m=m._init;try{return t(m($))}catch{}}return null}function e(m){return""+m}function r(m){try{e(m);var $=!1}catch{$=!0}if($){$=console;var z=$.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return z.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),e(m)}}function n(m){if(m===N)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===f)return"<...>";try{var $=t(m);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function s(){var m=A.A;return m===null?null:m.getOwner()}function l(){return Error("react-stack-top-frame")}function c(m){if(M.call(m,"key")){var $=Object.getOwnPropertyDescriptor(m,"key").get;if($&&$.isReactWarning)return!1}return m.key!==void 0}function a(m,$){function z(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}z.isReactWarning=!0,Object.defineProperty(m,"key",{get:z,configurable:!0})}function p(){var m=t(this.type);return I[m]||(I[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function j(m,$,z,H,W,G,te,re){return z=G.ref,m={$$typeof:F,type:m,key:$,props:G,_owner:W},(z!==void 0?z:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:p}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function h(m,$,z,H,W,G,te,re){var B=$.children;if(B!==void 0)if(H)if(U(B)){for(H=0;H<B.length;H++)w(B[H]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(B);if(M.call($,"key")){B=t(m);var ee=Object.keys($).filter(function(ae){return ae!=="key"});H=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Y[B+H]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
62
62
|
let props = %s;
|
|
63
63
|
<%s {...props} />
|
|
64
64
|
React keys must be passed directly to JSX without using spread:
|
|
65
65
|
let props = %s;
|
|
66
|
-
<%s key={someKey} {...props} />`,H,B,ee,B),
|
|
66
|
+
<%s key={someKey} {...props} />`,H,B,ee,B),Y[B+H]=!0)}if(B=null,z!==void 0&&(r(z),B=""+z),c($)&&(r($.key),B=""+$.key),"key"in $){z={};for(var ne in $)ne!=="key"&&(z[ne]=$[ne])}else z=$;return B&&a(z,typeof m=="function"?m.displayName||m.name||"Unknown":m),j(m,B,G,W,s(),z,te,re)}function w(m){typeof m=="object"&&m!==null&&m.$$typeof===F&&m._store&&(m._store.validated=1)}var g=C,F=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),u=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),A=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,U=Array.isArray,Z=console.createTask?console.createTask:function(){return null};g={"react-stack-bottom-frame":function(m){return m()}};var X,I={},D=g["react-stack-bottom-frame"].bind(g,l)(),O=Z(n(l)),Y={};ue.Fragment=N,ue.jsx=function(m,$,z,H,W){var G=1e4>A.recentlyCreatedOwnerStacks++;return h(m,$,z,!1,H,W,G?Error("react-stack-top-frame"):D,G?Z(n(m)):O)},ue.jsxs=function(m,$,z,H,W){var G=1e4>A.recentlyCreatedOwnerStacks++;return h(m,$,z,!0,H,W,G?Error("react-stack-top-frame"):D,G?Z(n(m)):O)}}()),ue}var Le;function mt(){return Le||(Le=1,process.env.NODE_ENV==="production"?he.exports=gt():he.exports=ht()),he.exports}var o=mt();const bt=({attributes:t,children:e,element:r})=>{const n=C.useRef(null),s=r.language||"plaintext";return o.jsxs("pre",{className:"rtf",...t,children:[o.jsx("div",{spellCheck:"false",className:"rtf code-language",children:s.toUpperCase()}),o.jsx("code",{ref:n,className:`language-${s}`,children:e})]})};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright (c) 2025 Jahylis
|
|
69
69
|
*
|
|
@@ -82,7 +82,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
82
82
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
83
83
|
*
|
|
84
84
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
85
|
-
*/const k={isMarkActive(t,e){const r=d.Editor.marks(t);return r?r[e]===!0:!1},toggleMark(t,e){k.isMarkActive(t,e)?d.Editor.removeMark(t,e):(d.Editor.addMark(t,e,!0),e==="subscript"?d.Editor.removeMark(t,"superscript"):e==="superscript"&&d.Editor.removeMark(t,"subscript"))},isBlockActive(t,e){const[r]=d.Editor.nodes(t,{match:n=>n.type===e});return!!r},isSelectionInList(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="bullet-list"||r.type==="numbered-list"});return!!e},getListStyleType(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="list-item"});return e[0].listStyleType},toggleBlock(t,e,r=null){const n=k.isBlockActive(t,e),s=e==="bullet-list"||e==="numbered-list";if((e==="h1"||e==="h2")&&d.Editor.removeMark(t,"fontSize"),s&&k.isSelectionInList(t)&&!r){d.Transforms.unwrapNodes(t,{match:c=>s&&!d.Editor.isEditor(c)&&d.Element.isElement(c)&&(c.type==="bullet-list"||c.type==="numbered-list"),split:!0}),d.Transforms.setNodes(t,{type:"paragraph"});return}if(r){d.Transforms.setNodes(t,{listStyleType:r});const c=d.Editor.range(t,t.selection).anchor.path;let
|
|
85
|
+
*/const k={isMarkActive(t,e){const r=d.Editor.marks(t);return r?r[e]===!0:!1},toggleMark(t,e){k.isMarkActive(t,e)?d.Editor.removeMark(t,e):(d.Editor.addMark(t,e,!0),e==="subscript"?d.Editor.removeMark(t,"superscript"):e==="superscript"&&d.Editor.removeMark(t,"subscript"))},isBlockActive(t,e){const[r]=d.Editor.nodes(t,{match:n=>n.type===e});return!!r},isSelectionInList(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="bullet-list"||r.type==="numbered-list"});return!!e},getListStyleType(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="list-item"});return e[0].listStyleType},toggleBlock(t,e,r=null){const n=k.isBlockActive(t,e),s=e==="bullet-list"||e==="numbered-list";if((e==="h1"||e==="h2")&&d.Editor.removeMark(t,"fontSize"),s&&k.isSelectionInList(t)&&!r){d.Transforms.unwrapNodes(t,{match:c=>s&&!d.Editor.isEditor(c)&&d.Element.isElement(c)&&(c.type==="bullet-list"||c.type==="numbered-list"),split:!0}),d.Transforms.setNodes(t,{type:"paragraph"});return}if(r){d.Transforms.setNodes(t,{listStyleType:r});const c=d.Editor.range(t,t.selection).anchor.path;let a=c;c.length===3?a=a.slice(0,1):c.length===4&&(a=a.slice(0,2)),d.Transforms.setNodes(t,{type:e},{at:a})}else{d.Transforms.unwrapNodes(t,{match:a=>s&&!d.Editor.isEditor(a)&&d.Element.isElement(a)&&a.type===e,split:!0});const c={type:n?"paragraph":s?"list-item":e};if(d.Transforms.setNodes(t,c),!n&&s){const a={type:e,children:[]};d.Transforms.wrapNodes(t,a)}}},isAlignActive(t,e){const[r]=d.Editor.nodes(t,{match:n=>n.align===e});return!!r},toggleAlign(t,e){const r=k.isAlignActive(t,e);["alignLeft","center","right"].forEach(n=>{d.Transforms.unsetNodes(t,{align:n})}),r||d.Transforms.setNodes(t,{align:e})},canIndent(t,e){const[r]=d.Editor.nodes(t,{match:n=>n.type==="list-item"});if(r){const[,n]=r;if(e==="indent")return!(n.length>2);if(n.length>2)return!0}return!1},handleIndent(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="list-item"});if(e){const[,r]=e,n=d.Editor.above(t,{match:s=>["bullet-list","numbered-list"].includes(s.type)})[0].type;try{const s=d.Path.parent(d.Path.parent(r)),l=d.Editor.node(t,s);if(d.Element.isElement(l[0])&&l[0].type===n)return;const c={type:n,children:[]},a=[r[0],r[1]+1];d.Transforms.insertNodes(t,c,{at:a});const p={...d.Editor.node(t,r)[0]},j=[r[0],r[1]+1,0];d.Transforms.insertNodes(t,p,{at:j}),d.Transforms.removeNodes(t,{at:r}),d.Transforms.setNodes(t,{type:"list-item"},{at:[r[0],r[1],0]})}catch(s){console.error("Error indenting list item:",s)}}},handleOutdent(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="list-item"});if(e){const[,r]=e,n=d.Editor.above(t,{match:s=>["bullet-list","numbered-list"].includes(s.type)})[0].type;try{const s=d.Path.parent(r),l=d.Editor.node(t,s);d.Element.isElement(l)&&l.type===n?d.Transforms.liftNodes(t,{at:r}):d.Transforms.unwrapNodes(t,{at:s,match:c=>d.Element.isElement(c)&&c.type===n,split:!0}),d.Transforms.setNodes(t,{type:"list-item"},{at:r})}catch(s){console.error("Error dedenting list item:",s)}}},isLinkActive(t){const{selection:e}=t;if(!e)return!1;const[r]=d.Editor.nodes(t,{match:n=>!d.Editor.isEditor(n)&&d.Node.isNode(n)&&n.type==="link"});return!!r},updateLink(t,e,r){const n=r?"_blank":"_self",s=r?"noopener noreferrer":"";if(k.isLinkActive(t))d.Transforms.setNodes(t,{href:e,target:n,rel:s},{match:l=>l.type==="link"});else{const{selection:l}=t;if(!l||d.Range.isCollapsed(l))return;const c={text:e};d.Range.isCollapsed(l)?d.Transforms.insertNodes(t,{type:"link",href:e,target:n,rel:s,children:[c]}):d.Transforms.setNodes(t,{type:"link",href:e,target:n,rel:s},{match:a=>d.Text.isText(a),split:!0}),d.Transforms.removeNodes(t,{match:a=>a.type==="paragraph"&&a.children.length===0})}},removeLink(t){if(t.selection){const{selection:e}=t,[r,n]=d.Editor.node(t,e);if(r&&r.type==="link"){const s=r.text,l=d.Path.parent(n),c=d.Node.get(t,l);d.Transforms.insertNodes(t,{type:c.type!=="list-item"?c.type:"paragraph",text:s},{at:n,match:a=>d.Text.isText(a)}),d.Transforms.removeNodes(t,{at:n})}else console.warn("No link found at the current selection.")}else console.warn("No selection found. Cannot remove link.")},applyTextColor(t,e){const{selection:r}=t;r&&d.Editor.addMark(t,"color",e)},applyBackgroundTextColor(t,e){const{selection:r}=t;r&&d.Editor.addMark(t,"bgColor",e)},applyFontSize(t,e){const{selection:r}=t;r&&d.Editor.addMark(t,"fontSize",e)},applyFontFamily(t,e){const{selection:r}=t;r&&d.Editor.addMark(t,"fontFamily",e)},isSelectionInCode(t){const[e]=d.Editor.nodes(t,{match:r=>d.Element.isElement(r)&&r.type==="code"});return!!e},getCurrentCodeLanguage(t){const[e]=d.Editor.nodes(t,{match:r=>d.Element.isElement(r)&&r.type==="code"});return e?e[0].language:"plaintext"},handleCode(t,e){const{selection:r}=t;if(r){const[n]=d.Editor.nodes(t,{match:s=>s.type==="paragraph"});if(n){const[,s]=n,l=n[0].children.map(a=>a.text).join(""),c={type:"code",language:e,children:[{text:l}]};d.Transforms.setNodes(t,c,{at:s}),d.Transforms.select(t,s)}else{const[s]=d.Editor.nodes(t,{match:l=>l.type==="code"});if(s){const[,l]=s;if(e==="init"){const a={type:"paragraph",children:[{text:s[0].children.map(p=>p.text).join("")}]};d.Transforms.setNodes(t,a,{at:l}),d.Transforms.unsetNodes(t,"language",{at:l}),d.Transforms.select(t,l)}else d.Transforms.setNodes(t,{language:e},{at:l}),d.Transforms.select(t,l)}}}},toggleBlockquote(t){const e=this.isBlockquoteActive(t);d.Transforms.setNodes(t,{type:e?"paragraph":"blockquote"},{match:r=>d.Element.isElement(r)&&d.Editor.isBlock(t,r)})},isBlockquoteActive(t){const[e]=d.Editor.nodes(t,{match:r=>d.Element.isElement(r)&&r.type==="blockquote"});return!!e},insertCodeBlock(t,e){const r={type:"code",language:this.getCurrentCodeLanguage(t),children:[{text:e}]},{selection:n}=t;if(!n)return;const[s,l]=d.Editor.parent(t,n);d.Element.isElement(s)&&(s.type==="paragraph"||s.type==="code")&&d.Node.string(s)===""&&d.Transforms.removeNodes(t,{at:l}),d.Transforms.insertNodes(t,r);const c=d.Editor.end(t,[]);d.Transforms.select(t,c)},insertImage(t,e){const r={type:"image",url:e,children:[{text:""}]},n={type:"paragraph",children:[{text:""}]};d.Transforms.insertNodes(t,r),d.Transforms.insertNodes(t,n)},handleFileChange(t,e){if(t.target.files[0]){const n=t.target.files[0];if(n){const s=new Image,l=new FileReader;l.onload=c=>{n.type==="image/svg+xml"?this.insertImage(e,c.target.result):(s.src=c.target.result,s.onload=()=>{const p=document.createElement("canvas"),j=p.getContext("2d"),h=800,w=600;let g=s.width,F=s.height;g>F?g>h&&(F*=h/g,g=h):F>w&&(g*=w/F,F=w),p.width=g,p.height=F,j.drawImage(s,0,0,g,F);const _=p.toDataURL("image/jpeg");this.insertImage(e,_)},s.onerror=()=>{console.error("Failed to load image.")})},l.onerror=()=>{console.error("Failed to read file.")},l.readAsDataURL(n)}}},insertTable(t,e,r){const n={type:"table",children:Array.from({length:e},()=>({type:"table-row",children:Array.from({length:r},()=>({type:"table-cell",children:[{text:""}]}))}))};d.Transforms.insertNodes(t,n)},isSelectionInTable(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="table"});return!!e},getTableFromSelection(t){const[e]=d.Editor.nodes(t,{match:r=>r.type==="table"});return e?e[0]:null},addRow(t){var r;const e=k.getTableFromSelection(t);if(e){if(e.children.length>=5)return;const n=(r=t.selection)==null?void 0:r.anchor.path,s=n[1],l={type:"table-row",children:e.children[s].children.map(a=>({...a,children:[{text:""}]}))},c=[n.slice(0,1),s+1];d.Transforms.insertNodes(t,l,{at:c})}},addColumn(t){var r,n;const e=k.getTableFromSelection(t);if(e){if(((r=e.children[0])==null?void 0:r.children.length)>=5)return;const s=(n=t.selection)==null?void 0:n.anchor.path;if(d.Node.get(t,s)){const c=s[s.length-2];c!==void 0?e.children.forEach((a,p)=>{const j={type:"table-cell",children:[{text:""}]},h=[...s.slice(0,1),p,c+1];h[h.length-1]<=a.children.length?d.Transforms.insertNodes(t,j,{at:h}):console.warn(`Cannot insert at path ${h}. Row does not have enough cells.`)}):console.error("Column index is undefined, unable to find the selected cell in the row.")}else console.error("Selected cell not found.")}},deleteRow(t){var r;const e=k.getTableFromSelection(t);if(e){if(e.children.length===1)return;const n=(r=t.selection)==null?void 0:r.anchor.path,s=n[1];if(s!==void 0){const l=[n[0],s];d.Transforms.removeNodes(t,{at:l})}else console.error("Selected row index is undefined.")}},deleteColumn(t){var r,n;const e=k.getTableFromSelection(t);if(e){if(((r=e.children[0])==null?void 0:r.children.length)===1)return;const s=(n=t.selection)==null?void 0:n.anchor.path,l=d.Node.get(t,s),c=s[s.length-1];let a=-1;e.children[c].children.forEach((p,j)=>{p.children[0]===l&&(a=j)}),a!==-1&&e.children.forEach((p,j)=>{if(p.children.length>a){const h=[s[0],j,a];d.Node.get(t,h)?d.Transforms.removeNodes(t,{at:h}):console.error(`Invalid path: ${h}`)}})}},deleteTable(t){var r;if(k.getTableFromSelection(t)){const n=(r=t.selection)==null?void 0:r.anchor.path.slice(0,1);n.length>0?d.Transforms.removeNodes(t,{at:n}):console.error("Table path is invalid.")}else console.error("No table selected.")},findNearestTable(t){const{selection:e}=t;if(!e)return null;const r=[],n=d.Editor.nodes(t,{match:c=>d.Element.isElement(c)&&c.type==="table",at:[],mode:"all"});for(const c of n)r.push(c);if(r.length===0)return null;let s=null,l=1/0;for(const[c,a]of r){const p=d.Path.compare(e.anchor.path,a);Math.abs(p)<l&&(l=Math.abs(p),s=[c,a])}return s},insertParagraphBeforeTable(t){const e=this.findNearestTable(t);if(!e)return;const[,r]=e;d.Transforms.insertNodes(t,{type:"paragraph",children:[{text:""}]},{at:r})},insertParagraphAfterTable(t){const e=this.findNearestTable(t);if(!e)return;const[,r]=e,n=[r[0]+1];d.Transforms.insertNodes(t,{type:"paragraph",children:[{text:""}]},{at:n})}};/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright (c) 2025 Jahylis
|
|
88
88
|
*
|
|
@@ -101,7 +101,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
101
101
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
102
102
|
*
|
|
103
103
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
104
|
-
*/const xt=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align||"left"};return
|
|
104
|
+
*/const xt=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align||"left"};return o.jsx("p",{className:"rtf",style:n,...t,children:e})},vt=({attributes:t,children:e,leaf:r})=>{let n=[];r.bold&&n.push("strong"),r.italic&&n.push("em"),r.underline&&n.push("u"),r.strikethrough&&n.push("del"),r.subscript&&!r.superscript&&n.push("sub"),!r.subscript&&r.superscript&&n.push("sup"),r.bgColor&&n.push("mark");const s={color:r.color||void 0,fontSize:r.fontSize||void 0,backgroundColor:r.bgColor||void 0,fontFamily:r.fontFamily||void 0},l=c=>{c.stopPropagation(),r.target==="_blank"?(window.open(r.href,r.target,r.rel?{rel:r.rel}:void 0),c.preventDefault()):window.location.href=r.href};return r.href?o.jsx("a",{...t,href:r.href,target:r.target||"_self",rel:r.rel||"noopener noreferrer",style:s,onClick:l,children:n.length===0?e:n.reduceRight((c,a)=>C.createElement(a,{...t},c),e)}):n.length===0?o.jsx("span",{...t,style:s,className:r.className??"",children:e}):n.reduceRight((c,a)=>C.createElement(a,{...t,style:s},c),e)};/**
|
|
105
105
|
* @license
|
|
106
106
|
* Copyright (c) 2025 Jahylis
|
|
107
107
|
*
|
|
@@ -120,7 +120,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
120
120
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
121
121
|
*
|
|
122
122
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
123
|
-
*/const yt=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align||"left",listStyleType:r.listStyleType||"disc"};switch(r.type){case"bullet-list":return
|
|
123
|
+
*/const yt=({attributes:t,children:e,element:r})=>{const n={textAlign:r.align||"left",listStyleType:r.listStyleType||"disc"};switch(r.type){case"bullet-list":return o.jsx("ul",{className:"rtf",style:n,...t,children:e});case"numbered-list":return o.jsx("ol",{className:"rtf",style:n,...t,children:e});case"list-item":return o.jsx("li",{className:"rtf",style:n,...t,children:e});default:return o.jsx("p",{className:"rtf",style:n,...t,children:e})}};/**
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright (c) 2025 Jahylis
|
|
126
126
|
*
|
|
@@ -139,7 +139,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
139
139
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
140
140
|
*
|
|
141
141
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
142
|
-
*/const wt=({attributes:t,children:e})=>
|
|
142
|
+
*/const wt=({attributes:t,children:e})=>o.jsx("blockquote",{className:"rtf",...t,style:{borderLeft:"4px solid #ccc",paddingLeft:"10px",color:"#666",margin:"20px 0"},children:e});/**
|
|
143
143
|
* @license
|
|
144
144
|
* Copyright (c) 2025 Jahylis
|
|
145
145
|
*
|
|
@@ -158,7 +158,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
158
158
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
159
159
|
*
|
|
160
160
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
161
|
-
*/function R(t){let e,r,n;if(t.startsWith("#"))t=t.replace(/^#/,""),e=parseInt(t.substring(0,2),16)/255,r=parseInt(t.substring(2,4),16)/255,n=parseInt(t.substring(4,6),16)/255;else if(t.startsWith("rgb")){const p=t.match(/\d+/g).map(Number);e=p[0]/255,r=p[1]/255,n=p[2]/255}else throw new Error("Format de couleur non pris en charge");const s=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),l=r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4),c=n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*s+.7152*l+.0722*c<.5}const $e=
|
|
161
|
+
*/function R(t){let e,r,n;if(t.startsWith("#"))t=t.replace(/^#/,""),e=parseInt(t.substring(0,2),16)/255,r=parseInt(t.substring(2,4),16)/255,n=parseInt(t.substring(4,6),16)/255;else if(t.startsWith("rgb")){const p=t.match(/\d+/g).map(Number);e=p[0]/255,r=p[1]/255,n=p[2]/255}else throw new Error("Format de couleur non pris en charge");const s=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),l=r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4),c=n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*s+.7152*l+.0722*c<.5}const $e=C.createContext({theme:"light",toggleTheme:()=>{},isDarkTheme:!1}),kt=({showTheme:t,backgroundDarkColor:e,borderDarkColor:r,imageDarkColor:n,children:s})=>{const[l,c]=C.useState("light");C.useEffect(()=>{if(t){const p=window.matchMedia("(prefers-color-scheme: dark)");c(p.matches?"dark":"light");const j=h=>{c(h.matches?"dark":"light")};return p.addEventListener("change",j),()=>{p.removeEventListener("change",j)}}},[]),C.useEffect(()=>{document.documentElement.setAttribute("data-theme",l)},[l]);const a=()=>{c(p=>p==="light"?"dark":"light")};return o.jsx($e.Provider,{value:{theme:l,toggleTheme:a,showTheme:t,isDarkTheme:l==="dark",backgroundDarkColor:e,borderDarkColor:r,imageDarkColor:n},children:s})},xe=()=>C.useContext($e),Me=C.createContext(),Ct=({backgroundColor:t,borderColor:e,imageColor:r,editor:n,children:s})=>{const{showTheme:l,isDarkTheme:c,backgroundDarkColor:a,borderDarkColor:p,imageDarkColor:j}=xe(),h=l&&c?a:t,w=l&&c?p:e,g=l&&c?j:r;return C.useEffect(()=>{document.documentElement.style.setProperty("--background-color",h),document.documentElement.style.setProperty("--border-color",w),document.documentElement.style.setProperty("--image-color",g)},[h,w,g]),o.jsx(Me.Provider,{value:{backgroundColor:h,borderColor:w,editor:n,imageColor:g},children:o.jsx("div",{className:"rtf react-text-forge",style:{backgroundColor:h,borderColor:w},children:s})})},q=()=>C.useContext(Me),jt=({onChange:t,selectStyle:e,toggleForm:r})=>{const n=[{value:"disc",label:"Disque"},{value:"circle",label:"Cercle"},{value:"square",label:"Carré"},{value:"'✔'",label:"Check"},{value:"'✘'",label:"Croix"},{value:"'➢'",label:"Petite flèche"},{value:"'➔'",label:"Flèche épaisse"}],{editor:s}=q();return o.jsx("ul",{onMouseLeave:()=>r(!1),style:e,className:"rtf dropdown-menu",children:n.map(l=>o.jsx("li",{value:l.value,onClick:()=>t(l.value),style:{backgroundColor:`${l.value===k.getListStyleType(s)?`color-mix(in srgb, ${e.backgroundColor} 80%, ${R(e.backgroundColor)?"white":"black"})`:e.backgroundColor}`},children:l.label},l.value))})},Ft=({onChange:t,selectStyle:e,toggleForm:r})=>{const n=[{value:"decimal",label:"Décimal"},{value:"upper-roman",label:"Lettres Romaines majuscules"},{value:"lower-roman",label:"Lettres Romaines minuscules"},{value:"upper-greek",label:"Lettres Grecques majuscules"},{value:"lower-greek",label:"Lettres Grecques minuscules"}],{editor:s}=q();return o.jsx("ul",{onMouseLeave:()=>r(!1),style:e,className:"rtf dropdown-menu",children:n.map(l=>o.jsx("li",{value:l.value,onClick:()=>t(l.value),style:{backgroundColor:`${l.value===k.getListStyleType(s)?`color-mix(in srgb, ${e.backgroundColor} 80%, ${R(e.backgroundColor)?"white":"black"})`:e.backgroundColor}`},children:l.label},l.value))})};/**
|
|
162
162
|
* @license
|
|
163
163
|
* Copyright (c) 2025 Jahylis
|
|
164
164
|
*
|
|
@@ -177,7 +177,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
177
177
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
178
178
|
*
|
|
179
179
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
180
|
-
*/function V({format:t,imageColor:e}){return(()=>{switch(t){case"addColumn":return a.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"Edit / Add_Column",children:a.jsx("path",{id:"Vector",d:"M5 17H8M8 17H11M8 17V14M8 17V20M14 21H15C16.1046 21 17 20.1046 17 19V5C17 3.89543 16.1046 3 15 3H13C11.8954 3 11 3.89543 11 5V11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"addRow":return a.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"Edit / Add_Row",children:a.jsx("path",{id:"Vector",d:"M3 14V15C3 16.1046 3.89543 17 5 17L19 17C20.1046 17 21 16.1046 21 15L21 13C21 11.8954 20.1046 11 19 11H13M10 8H7M7 8H4M7 8V5M7 8V11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"bgColor":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M86.6 9.4C74.1-3.1 53.9-3.1 41.4 9.4s-12.5 32.8 0 45.3L122.7 136 30.6 228.1c-37.5 37.5-37.5 98.3 0 135.8L148.1 481.4c37.5 37.5 98.3 37.5 135.8 0L474.3 290.9c28.1-28.1 28.1-73.7 0-101.8L322.9 37.7c-28.1-28.1-73.7-28.1-101.8 0L168 90.7 86.6 9.4zM168 181.3l49.4 49.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136l53.1-53.1c3.1-3.1 8.2-3.1 11.3 0L429.1 234.3c3.1 3.1 3.1 8.2 0 11.3L386.7 288 67.5 288c1.4-5.4 4.2-10.4 8.4-14.6L168 181.3z"})});case"blockCode":return a.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:a.jsx("path",{fill:e,fillRule:"evenodd",d:"M2 6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6zm5 1a1 1 0 0 0 0 2h5a1 1 0 1 0 0-2H7zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2zm-8 4a1 1 0 1 0 0 2h1a1 1 0 1 0 0-2H7zm4 0a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6zm-4 4a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2H7zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2z",clipRule:"evenodd"})});case"blockquote":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"})});case"bold":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:a.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"})});case"bulletList":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"})});case"center":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"})});case"color":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"})});case"deleteColumn":return a.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"Edit / Delete_Column",children:a.jsx("path",{id:"Vector",d:"M10 21H9C7.89543 21 7 20.1046 7 19V5C7 3.89543 7.89543 3 9 3H11C12.1046 3 13 3.89543 13 5V11M19 16H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"deleteRow":return a.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"Edit / Delete_Row",children:a.jsx("path",{id:"Vector",d:"M14 16H20M21 10V9C21 7.89543 20.1046 7 19 7H5C3.89543 7 3 7.89543 3 9V11C3 12.1046 3.89543 13 5 13H11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"deleteTable":return a.jsx("svg",{className:"rtf",fill:e,width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M1800 1740c0 33-26.88 60-60 60H180c-33.12 0-60-27-60-60V180c0-33.12 26.88-60 60-60h1560c33.12 0 60 26.88 60 60v1560ZM1740 0H180C80.76 0 0 80.76 0 180v1560c0 99.24 80.76 180 180 180h1560c99.24 0 180-80.76 180-180V180c0-99.24-80.76-180-180-180Zm-235.08 245.388L960 790.308l-544.92-544.92-169.68 169.68 544.92 544.92-544.92 544.92 169.68 169.68L960 1129.668l544.92 544.92 169.68-169.68-544.92-544.92 544.92-544.92-169.68-169.68Z",fillRule:"evenodd"})});case"enter":return a.jsx("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M20 7V8.2C20 9.88016 20 10.7202 19.673 11.362C19.3854 11.9265 18.9265 12.3854 18.362 12.673C17.7202 13 16.8802 13 15.2 13H4M4 13L8 9M4 13L8 17"})});case"fullscreen":return a.jsxs("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("path",{fill:e,d:"M4 2C2.89543 2 2 2.89543 2 4V8C2 8.55228 2.44772 9 3 9C3.55228 9 4 8.55228 4 8V4H8C8.55228 4 9 3.55228 9 3C9 2.44772 8.55228 2 8 2H4Z"}),a.jsx("path",{fill:e,d:"M20 2C21.1046 2 22 2.89543 22 4V8C22 8.55228 21.5523 9 21 9C20.4477 9 20 8.55228 20 8V4H16C15.4477 4 15 3.55228 15 3C15 2.44772 15.4477 2 16 2H20Z"}),a.jsx("path",{fill:e,d:"M20 22C21.1046 22 22 21.1046 22 20V16C22 15.4477 21.5523 15 21 15C20.4477 15 20 15.4477 20 16V20H16C15.4477 20 15 20.4477 15 21C15 21.5523 15.4477 22 16 22H20Z"}),a.jsx("path",{fill:e,d:"M2 20C2 21.1046 2.89543 22 4 22H8C8.55228 22 9 21.5523 9 21C9 20.4477 8.55228 20 8 20H4V16C4 15.4477 3.55228 15 3 15C2.44772 15 2 15.4477 2 16V20Z"})]});case"fullscreenExit":return a.jsxs("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("path",{fill:e,d:"M7 9C8.10457 9 9 8.10457 9 7V3C9 2.44772 8.55228 2 8 2C7.44772 2 7 2.44772 7 3V7H3C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9H7Z"}),a.jsx("path",{fill:e,d:"M17 9C15.8954 9 15 8.10457 15 7V3C15 2.44772 15.4477 2 16 2C16.5523 2 17 2.44772 17 3V7H21C21.5523 7 22 7.44772 22 8C22 8.55228 21.5523 9 21 9H17Z"}),a.jsx("path",{fill:e,d:"M17 15C15.8954 15 15 15.8954 15 17V21C15 21.5523 15.4477 22 16 22C16.5523 22 17 21.5523 17 21V17H21C21.5523 17 22 16.5523 22 16C22 15.4477 21.5523 15 21 15H17Z"}),a.jsx("path",{fill:e,d:"M9 17C9 15.8954 8.10457 15 7 15H3C2.44772 15 2 15.4477 2 16C2 16.5523 2.44772 17 3 17H7V21C7 21.5523 7.44772 22 8 22C8.55228 22 9 21.5523 9 21V17Z"})]});case"fontFamily":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"})});case"href":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",children:a.jsx("path",{fill:e,d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"})});case"image":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"})});case"indent":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"})});case"italic":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:a.jsx("path",{fill:e,d:"M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"})});case"left":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})});case"more":return a.jsx("svg",{className:"rtf",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{fill:e,fillRule:"evenodd",d:"M12 3a2 2 0 10-4 0 2 2 0 004 0zm-2 5a2 2 0 110 4 2 2 0 010-4zm0 7a2 2 0 110 4 2 2 0 010-4z"})});case"numberedList":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"})});case"outdent":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"})});case"redo":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"})});case"right":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})});case"size":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:a.jsx("path",{fill:e,d:"M64 128l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L160 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 192-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-192 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"})});case"strikethrough":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"})});case"subscript":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z"})});case"superscript":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64z"})});case"table":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"})});case"underline":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:a.jsx("path",{fill:e,d:"M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"})});case"undo":return a.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:a.jsx("path",{fill:e,d:"M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"})});default:return null}})()}const Et=({format:t,isActive:e,onMouseDown:r})=>{const{backgroundColor:n,editor:s,imageColor:l}=q(),[c,o]=j.useState(!1),p={backgroundColor:n,color:l},F=h=>{k.toggleBlock(s,t==="bulletList"?"bullet-list":"numbered-list",h),o(!1)};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"rtf tool",children:[a.jsx("div",{onMouseDown:h=>{h.preventDefault(),r(t)},children:a.jsx(V,{format:t,imageColor:l})}),e&&a.jsx("div",{className:"rtf tool tool--arrow",style:{color:p.color},onClick:()=>o(!c),children:c?"↑":"↓"})]}),c&&(t==="bulletList"?a.jsx(jt,{selectStyle:p,onChange:F,toggleForm:o}):a.jsx(Ft,{selectStyle:p,onChange:F,toggleForm:o}))]})};function _e({disabled:t=!1,elements:e,elementSelected:r,format:n,isOpen:s,setIsOpen:l,onClick:c}){const{backgroundColor:o,imageColor:p}=q(),F=()=>{l(!s)},h=w=>{c(w),l(!1)};return a.jsxs("div",{className:"rtf dropdown tool",children:[a.jsx("button",{onClick:F,className:"rtf dropdown-toggle",disabled:t,children:a.jsx(V,{format:n,imageColor:p})}),s&&a.jsx("ul",{style:{backgroundColor:o,color:p},className:"rtf dropdown-menu",onMouseLeave:F,children:e.map((w,g)=>a.jsx("li",{style:{backgroundColor:`${r&&w===r?`color-mix(in srgb, ${o} 80%, ${R(o)?"white":"black"})`:o}`},onClick:()=>h(w),children:w},g))})]})}const St=({disabled:t,sizeSelected:e,onSelectSize:r})=>{const[n,s]=j.useState(!1),l=["10px","12px","14px","16px","18px","20px","24px","28px","36px"];return a.jsx(_e,{disabled:t,elements:l,elementSelected:e,format:"size",isOpen:n,setIsOpen:s,onClick:r})},Tt=({fontFamilySelected:t,onSelectFontFamily:e})=>{const[r,n]=j.useState(!1),s=["Arial","Arial Black","Bookman","Comic Sans MS","Courier","Courier New","Garamond","Georgia","Helvetica","Impact","Palatino","Times","Times New Roman","Trebuchet MS","Verdana"];return a.jsx(_e,{elements:s,elementSelected:t,format:"fontFamily",isOpen:r,setIsOpen:n,onClick:e})},Nt=({onClose:t,initialUrl:e="",isOpenInNewTab:r})=>{const[n,s]=j.useState(""),{editor:l,backgroundColor:c,imageColor:o}=q(),[p,F]=j.useState(!1),[h,w]=j.useState(l.selection),g={backgroundColor:c,color:o},E={color:R(c)?"#FFF":"#000"},M={backgroundColor:`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`,color:E.color},A={backgroundColor:c!=="#800020"?"#800020":"color-mix(in srgb, #800020 80%, black)",color:E.color},N={backgroundColor:c!=="#6c757d"?"#6c757d":"color-mix(in srgb, #6c757d 30%, black)",color:E.color},L=()=>{n&&(k.updateLink(l,n,p),t())},i=()=>{h&&se.ReactEditor.focus(l)},u=()=>{k.removeLink(l),t()};return j.useEffect(()=>{l.selection&&w(l.selection)},[]),j.useEffect(()=>{s(e),F(r)},[e,r]),a.jsxs("div",{onMouseLeave:t,style:g,className:"rtf link-form",children:[a.jsx("input",{className:"rtf",type:"text",placeholder:"Enter URL",value:n,onBlur:i,onChange:b=>s(b.target.value)}),a.jsxs("label",{className:"rtf",children:[a.jsx("input",{className:"rtf",type:"checkbox",checked:p,onBlur:i,onChange:()=>F(!p)}),"Ouvrir dans un nouvel onglet"]}),a.jsxs("div",{className:"rtf link-form-actions",children:[e?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"rtf",style:M,onClick:L,children:"Modifier"}),a.jsx("button",{className:"rtf",style:A,onClick:u,children:"Supprimer"})]}):a.jsx("button",{className:"rtf",style:M,onClick:L,children:"Valider"}),a.jsx("button",{className:"rtf",style:N,onClick:t,children:"Annuler"})]})]})};/**
|
|
180
|
+
*/function V({format:t,imageColor:e}){return(()=>{switch(t){case"addColumn":return o.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"Edit / Add_Column",children:o.jsx("path",{id:"Vector",d:"M5 17H8M8 17H11M8 17V14M8 17V20M14 21H15C16.1046 21 17 20.1046 17 19V5C17 3.89543 16.1046 3 15 3H13C11.8954 3 11 3.89543 11 5V11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"addRow":return o.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"Edit / Add_Row",children:o.jsx("path",{id:"Vector",d:"M3 14V15C3 16.1046 3.89543 17 5 17L19 17C20.1046 17 21 16.1046 21 15L21 13C21 11.8954 20.1046 11 19 11H13M10 8H7M7 8H4M7 8V5M7 8V11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"bgColor":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M86.6 9.4C74.1-3.1 53.9-3.1 41.4 9.4s-12.5 32.8 0 45.3L122.7 136 30.6 228.1c-37.5 37.5-37.5 98.3 0 135.8L148.1 481.4c37.5 37.5 98.3 37.5 135.8 0L474.3 290.9c28.1-28.1 28.1-73.7 0-101.8L322.9 37.7c-28.1-28.1-73.7-28.1-101.8 0L168 90.7 86.6 9.4zM168 181.3l49.4 49.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136l53.1-53.1c3.1-3.1 8.2-3.1 11.3 0L429.1 234.3c3.1 3.1 3.1 8.2 0 11.3L386.7 288 67.5 288c1.4-5.4 4.2-10.4 8.4-14.6L168 181.3z"})});case"blockCode":return o.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:o.jsx("path",{fill:e,fillRule:"evenodd",d:"M2 6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6zm5 1a1 1 0 0 0 0 2h5a1 1 0 1 0 0-2H7zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2zm-8 4a1 1 0 1 0 0 2h1a1 1 0 1 0 0-2H7zm4 0a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6zm-4 4a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2H7zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2z",clipRule:"evenodd"})});case"blockquote":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"})});case"bold":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:o.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"})});case"bulletList":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"})});case"center":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"})});case"color":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"})});case"deleteColumn":return o.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"Edit / Delete_Column",children:o.jsx("path",{id:"Vector",d:"M10 21H9C7.89543 21 7 20.1046 7 19V5C7 3.89543 7.89543 3 9 3H11C12.1046 3 13 3.89543 13 5V11M19 16H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"deleteRow":return o.jsx("svg",{className:"rtf",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"Edit / Delete_Row",children:o.jsx("path",{id:"Vector",d:"M14 16H20M21 10V9C21 7.89543 20.1046 7 19 7H5C3.89543 7 3 7.89543 3 9V11C3 12.1046 3.89543 13 5 13H11",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});case"deleteTable":return o.jsx("svg",{className:"rtf",fill:e,width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M1800 1740c0 33-26.88 60-60 60H180c-33.12 0-60-27-60-60V180c0-33.12 26.88-60 60-60h1560c33.12 0 60 26.88 60 60v1560ZM1740 0H180C80.76 0 0 80.76 0 180v1560c0 99.24 80.76 180 180 180h1560c99.24 0 180-80.76 180-180V180c0-99.24-80.76-180-180-180Zm-235.08 245.388L960 790.308l-544.92-544.92-169.68 169.68 544.92 544.92-544.92 544.92 169.68 169.68L960 1129.668l544.92 544.92 169.68-169.68-544.92-544.92 544.92-544.92-169.68-169.68Z",fillRule:"evenodd"})});case"enter":return o.jsx("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M20 7V8.2C20 9.88016 20 10.7202 19.673 11.362C19.3854 11.9265 18.9265 12.3854 18.362 12.673C17.7202 13 16.8802 13 15.2 13H4M4 13L8 9M4 13L8 17"})});case"fullscreen":return o.jsxs("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("path",{fill:e,d:"M4 2C2.89543 2 2 2.89543 2 4V8C2 8.55228 2.44772 9 3 9C3.55228 9 4 8.55228 4 8V4H8C8.55228 4 9 3.55228 9 3C9 2.44772 8.55228 2 8 2H4Z"}),o.jsx("path",{fill:e,d:"M20 2C21.1046 2 22 2.89543 22 4V8C22 8.55228 21.5523 9 21 9C20.4477 9 20 8.55228 20 8V4H16C15.4477 4 15 3.55228 15 3C15 2.44772 15.4477 2 16 2H20Z"}),o.jsx("path",{fill:e,d:"M20 22C21.1046 22 22 21.1046 22 20V16C22 15.4477 21.5523 15 21 15C20.4477 15 20 15.4477 20 16V20H16C15.4477 20 15 20.4477 15 21C15 21.5523 15.4477 22 16 22H20Z"}),o.jsx("path",{fill:e,d:"M2 20C2 21.1046 2.89543 22 4 22H8C8.55228 22 9 21.5523 9 21C9 20.4477 8.55228 20 8 20H4V16C4 15.4477 3.55228 15 3 15C2.44772 15 2 15.4477 2 16V20Z"})]});case"fullscreenExit":return o.jsxs("svg",{className:"rtf",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("path",{fill:e,d:"M7 9C8.10457 9 9 8.10457 9 7V3C9 2.44772 8.55228 2 8 2C7.44772 2 7 2.44772 7 3V7H3C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9H7Z"}),o.jsx("path",{fill:e,d:"M17 9C15.8954 9 15 8.10457 15 7V3C15 2.44772 15.4477 2 16 2C16.5523 2 17 2.44772 17 3V7H21C21.5523 7 22 7.44772 22 8C22 8.55228 21.5523 9 21 9H17Z"}),o.jsx("path",{fill:e,d:"M17 15C15.8954 15 15 15.8954 15 17V21C15 21.5523 15.4477 22 16 22C16.5523 22 17 21.5523 17 21V17H21C21.5523 17 22 16.5523 22 16C22 15.4477 21.5523 15 21 15H17Z"}),o.jsx("path",{fill:e,d:"M9 17C9 15.8954 8.10457 15 7 15H3C2.44772 15 2 15.4477 2 16C2 16.5523 2.44772 17 3 17H7V21C7 21.5523 7.44772 22 8 22C8.55228 22 9 21.5523 9 21V17Z"})]});case"fontFamily":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"})});case"href":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",children:o.jsx("path",{fill:e,d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"})});case"image":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"})});case"indent":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"})});case"italic":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:o.jsx("path",{fill:e,d:"M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"})});case"left":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})});case"more":return o.jsx("svg",{className:"rtf",viewBox:"0 0 20 20",fill:"none",children:o.jsx("path",{fill:e,fillRule:"evenodd",d:"M12 3a2 2 0 10-4 0 2 2 0 004 0zm-2 5a2 2 0 110 4 2 2 0 010-4zm0 7a2 2 0 110 4 2 2 0 010-4z"})});case"numberedList":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"})});case"outdent":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"})});case"redo":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"})});case"right":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"})});case"size":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:o.jsx("path",{fill:e,d:"M64 128l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L160 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 192-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-192 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"})});case"strikethrough":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"})});case"subscript":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z"})});case"superscript":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64z"})});case"table":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"})});case"underline":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:o.jsx("path",{fill:e,d:"M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"})});case"undo":return o.jsx("svg",{className:"rtf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:o.jsx("path",{fill:e,d:"M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"})});default:return null}})()}const Et=({format:t,isActive:e,onMouseDown:r})=>{const{backgroundColor:n,editor:s,imageColor:l}=q(),[c,a]=C.useState(!1),p={backgroundColor:n,color:l},j=h=>{k.toggleBlock(s,t==="bulletList"?"bullet-list":"numbered-list",h),a(!1)};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{className:"rtf tool",children:[o.jsx("div",{onMouseDown:h=>{h.preventDefault(),r(t)},children:o.jsx(V,{format:t,imageColor:l})}),e&&o.jsx("div",{className:"rtf tool tool--arrow",style:{color:p.color},onClick:()=>a(!c),children:c?"↑":"↓"})]}),c&&(t==="bulletList"?o.jsx(jt,{selectStyle:p,onChange:j,toggleForm:a}):o.jsx(Ft,{selectStyle:p,onChange:j,toggleForm:a}))]})};function _e({disabled:t=!1,elements:e,elementSelected:r,format:n,isOpen:s,setIsOpen:l,onClick:c}){const{backgroundColor:a,imageColor:p}=q(),j=()=>{l(!s)},h=w=>{c(w),l(!1)};return o.jsxs("div",{className:"rtf dropdown tool",children:[o.jsx("button",{onClick:j,className:"rtf dropdown-toggle",disabled:t,children:o.jsx(V,{format:n,imageColor:p})}),s&&o.jsx("ul",{style:{backgroundColor:a,color:p},className:"rtf dropdown-menu",onMouseLeave:j,children:e.map((w,g)=>o.jsx("li",{style:{backgroundColor:`${r&&w===r?`color-mix(in srgb, ${a} 80%, ${R(a)?"white":"black"})`:a}`},onClick:()=>h(w),children:w},g))})]})}const Tt=({disabled:t,sizeSelected:e,onSelectSize:r})=>{const[n,s]=C.useState(!1),l=["10px","12px","14px","16px","18px","20px","24px","28px","36px"];return o.jsx(_e,{disabled:t,elements:l,elementSelected:e,format:"size",isOpen:n,setIsOpen:s,onClick:r})},St=({fontFamilySelected:t,onSelectFontFamily:e})=>{const[r,n]=C.useState(!1),s=["Arial","Arial Black","Bookman","Comic Sans MS","Courier","Courier New","Garamond","Georgia","Helvetica","Impact","Palatino","Times","Times New Roman","Trebuchet MS","Verdana"];return o.jsx(_e,{elements:s,elementSelected:t,format:"fontFamily",isOpen:r,setIsOpen:n,onClick:e})},Nt=({onClose:t,initialUrl:e="",isOpenInNewTab:r})=>{const[n,s]=C.useState(""),{editor:l,backgroundColor:c,imageColor:a}=q(),[p,j]=C.useState(!1),[h,w]=C.useState(l.selection),g={backgroundColor:c,color:a},F={color:R(c)?"#FFF":"#000"},_={backgroundColor:`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`,color:F.color},N={backgroundColor:c!=="#800020"?"#800020":"color-mix(in srgb, #800020 80%, black)",color:F.color},S={backgroundColor:c!=="#6c757d"?"#6c757d":"color-mix(in srgb, #6c757d 30%, black)",color:F.color},L=()=>{n&&(k.updateLink(l,n,p),t())},i=()=>{h&&se.ReactEditor.focus(l)},u=()=>{k.removeLink(l),t()};return C.useEffect(()=>{l.selection&&w(l.selection)},[]),C.useEffect(()=>{s(e),j(r)},[e,r]),o.jsxs("div",{onMouseLeave:t,style:g,className:"rtf link-form",children:[o.jsx("input",{className:"rtf",type:"text",placeholder:"Enter URL",value:n,onBlur:i,onChange:b=>s(b.target.value)}),o.jsxs("label",{className:"rtf",children:[o.jsx("input",{className:"rtf",type:"checkbox",checked:p,onBlur:i,onChange:()=>j(!p)}),"Ouvrir dans un nouvel onglet"]}),o.jsxs("div",{className:"rtf link-form-actions",children:[e?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"rtf",style:_,onClick:L,children:"Modifier"}),o.jsx("button",{className:"rtf",style:N,onClick:u,children:"Supprimer"})]}):o.jsx("button",{className:"rtf",style:_,onClick:L,children:"Valider"}),o.jsx("button",{className:"rtf",style:S,onClick:t,children:"Annuler"})]})]})};/**
|
|
181
181
|
* @license
|
|
182
182
|
* Copyright (c) 2025 Jahylis
|
|
183
183
|
*
|
|
@@ -196,7 +196,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
196
196
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
197
197
|
*
|
|
198
198
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
199
|
-
*/function ve(t){const[e,r]=j.useState(""),[n,s]=j.useState(""),[l,c]=j.useState(!1),[o,p]=j.useState(""),[F,h]=j.useState(""),[w,g]=j.useState("paragraph"),[E,M]=j.useState(!1),[A,N]=j.useState(""),[L,i]=j.useState(!1),u=()=>{i(!L)},b=()=>{M(!E)};return{activeBlock:w,colorMode:n,setColorMode:s,openInNewTab:l,setOpenInNewTab:c,selectedBackgroundColor:F,setSelectedBackgroundColor:h,selectedColor:o,setSelectedColor:p,selectedLanguage:A,setSelectedLanguage:N,selectedLink:e,setSelectedLink:r,showColorPicker:E,showLinkForm:L,setShowLinkForm:i,detectCurrentLanguage:()=>{const{selection:x}=t;if(x){const[S]=d.Editor.nodes(t,{match:T=>T.type==="code"});N(S?S[0].language:null)}},toggleLinkForm:u,toggleColorPicker:b,handleColorChange:x=>{k.applyTextColor(t,x),b()},handleBackgroundColorChange:x=>{k.applyBackgroundTextColor(t,x),b()},handleBlockTypeChange:x=>{k.toggleBlock(t,x),g(x)}}}function At({selectedColor:t,onSelectColor:e,onClose:r}){const[n,s]=j.useState("#ffffff"),{editor:l,backgroundColor:c,borderColor:o,imageColor:p}=q(),F={backgroundColor:c,color:p},h={backgroundColor:`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`,color:R(c)?"#FFF":"#000"},w={backgroundColor:c!=="#6c757d"?"#6c757d":"color-mix(in srgb, #6c757d 30%, black)",color:R(c)?"#FFF":"#000"},g={default:{picker:{background:c,color:p,border:o}}},E=N=>{se.ReactEditor.focus(l),s(N.hex)},M=()=>{n&&(e(n),r())},A=()=>{e(""),r()};return j.useEffect(()=>{t&&s(t)},[t]),a.jsxs("div",{onMouseLeave:r,className:"rtf color-picker-popup",children:[a.jsx(Ue.SketchPicker,{styles:g,color:n,onChangeComplete:E}),a.jsxs("div",{style:F,className:"rtf link-form-actions",children:[a.jsx("button",{className:"rtf",style:h,onClick:M,disabled:!n,children:"Appliquer"}),a.jsx("button",{className:"rtf",style:w,onClick:A,children:"Annuler"})]})]})}const Lt=()=>{const{editor:t,backgroundColor:e,imageColor:r}=q(),n=k.isBlockquoteActive(t);return a.jsx("button",{onMouseDown:s=>{s.preventDefault(),k.toggleBlockquote(t)},style:{backgroundColor:n?`color-mix(in srgb, ${e} 80%, ${R(e)?"white":"black"})`:""},className:"rtf tool",children:a.jsx(V,{format:"blockquote",imageColor:r})})},Q=({text:t,children:e,position:r="top"})=>{var h;const[n,s]=j.useState(!1),{isDarkTheme:l,backgroundDarkColor:c,imageDarkColor:o}=xe(),p=j.Children.count(e),F=j.Children.map(e,w=>w);return a.jsxs("div",{className:"tooltip-container",style:{display:p===1&&((h=F[0].props.style)==null?void 0:h.display)==="none"?"none":"inline-block"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[e,n&&a.jsx("div",{style:{backgroundColor:l?"black":c,color:o,borderColor:o},className:`tooltip tooltip--${r} tooltip--visible`,role:"tooltip","aria-label":t,children:t})]})},ze=({activeMarks:t,format:e,isActive:r,tooltip:n})=>{const[s,l]=j.useState(""),{backgroundColor:c,editor:o,imageColor:p}=q(),{activeBlock:F,colorMode:h,setColorMode:w,openInNewTab:g,detectCurrentLanguage:E,handleColorChange:M,handleBackgroundColorChange:A,setOpenInNewTab:N,selectedBackgroundColor:L,setSelectedBackgroundColor:i,selectedColor:u,setSelectedColor:b,selectedLink:v,setSelectedLink:y,showColorPicker:f,showLinkForm:C,setShowLinkForm:x,toggleColorPicker:S,toggleLinkForm:T}=ve(o),P=F==="h1"||F==="h2",K=["left","center","right"],U=D=>{k.applyFontSize(o,D)},I=D=>{k.applyFontFamily(o,D),l(D)},J=()=>{setTimeout(()=>se.ReactEditor.focus(o),0)};return j.useEffect(()=>{E();const{selection:D}=o;if(D){const[O]=d.Editor.nodes(o,{match:G=>G.type==="link"});O?(N(O[0].target==="_blank"),y(O[0].href)):(N(!1),y(""))}},[o.selection]),a.jsx(Q,{text:n,position:"bottom",children:e==="indent"||e==="outdent"?a.jsx("div",{children:a.jsx("button",{title:n,className:"rtf tool",onClick:()=>e==="indent"?k.handleIndent(o):k.handleOutdent(o),disabled:!r,children:a.jsx(V,{format:e,imageColor:r?p:`color-mix(in srgb, ${p} 40%, black)`})})}):e==="fontSize"?a.jsx(St,{disabled:P,onSelectSize:U,sizeSelected:r}):e==="fontFamily"?a.jsx(Tt,{fontFamilySelected:s,onSelectFontFamily:I}):e==="bulletList"||e==="numberedList"?a.jsx("div",{className:"rtf dropdown",children:a.jsx(Et,{format:e,isActive:r,onMouseDown:()=>{e=e==="bulletList"?"bullet-list":"numbered-list",k.toggleBlock(o,e)}})}):e==="href"?a.jsxs("div",{className:"rtf dropdown",children:[a.jsx("button",{onMouseDown:D=>{D.preventDefault(),J(),T()},title:n,className:`rtf tool tool--${r?"active":"inactive"}`,children:a.jsx(V,{format:e,imageColor:p})}),C&&a.jsx(Nt,{onClose:()=>x(!1),initialUrl:v,isOpenInNewTab:g})]}):e==="color"||e==="bgColor"?a.jsxs("div",{className:"rtf dropdown",children:[a.jsx("button",{title:n,onMouseDown:D=>{D.preventDefault(),J(),e==="color"?(b(t[e]),w("color"),S()):(i(t[e]),w("bgColor"),S())},className:`rtf tool tool--${r?"active":"inactive"}`,children:a.jsx(V,{format:e,imageColor:p})}),f&&a.jsx(At,{selectedColor:h==="color"?u:L,onSelectColor:h==="color"?M:A,onClose:S})]}):e==="blockquote"?a.jsx(Lt,{tooltip:n}):a.jsx("button",{onMouseDown:D=>{D.preventDefault(),K.includes(e)?k.toggleAlign(o,e):k.toggleMark(o,e)},title:n,style:{backgroundColor:r?`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`:""},className:"rtf tool",children:a.jsx(V,{format:e,imageColor:p})})})},$t=j.forwardRef(({tooltip:t},e)=>{const{backgroundColor:r,imageColor:n}=q(),{editor:s}=q(),{activeBlock:l,handleBlockTypeChange:c}=ve(s),o=[{type:"paragraph",name:"Paragraphe"},{type:"h1",name:"Titre"},{type:"h2",name:"Sous-titre"}],p={backgroundColor:r,color:n},F=h=>{const w=h.target.value;c(w)};return a.jsx(Q,{text:t,position:"bottom",children:a.jsx("select",{ref:e,className:"rtf",value:l,onChange:F,style:p,children:o.map(h=>a.jsx("option",{className:"rtf",value:h.type,children:h.name},h.type))})})}),Pe=j.forwardRef((t,e)=>{const[r,n]=j.useState(!1),{backgroundColor:s,editor:l,imageColor:c}=q(),{selectedLanguage:o,setSelectedLanguage:p}=ve(l),F={backgroundColor:s,color:c},h={cs:"C#",cpp:"C++",css:"CSS",diff:"Diff",html:"HTML",java:"Java",javascript:"JavaScript",php:"PHP",python:"Python",ruby:"Ruby",typescript:"TypeScript",xml:"XML"},w=()=>{n(!r)},g=E=>{p(E),k.handleCode(l,E),n(!1)};return a.jsxs("div",{ref:e,className:`rtf dropdown tool ${o&&o!=="init"&&o!==""?"tool--active":""}`,children:[a.jsx("button",{className:"rtf dropdown-toggle",onClick:w,children:a.jsx(V,{format:"blockCode",imageColor:c})}),r&&a.jsxs("ul",{style:F,onMouseLeave:w,className:"rtf dropdown-menu",children:[o&&a.jsx("li",{onClick:()=>g("init"),children:"Réinitialiser"}),Object.keys(h).map(E=>a.jsx("li",{onClick:()=>g(E),style:{cursor:"pointer",padding:"5px 10px",backgroundColor:o&&E===o?`color-mix(in srgb, ${s} 80%, ${R(s)?"white":"black"})`:s},children:h[E]},E))]})]})}),Oe=j.forwardRef((t,e)=>{const{editor:r,imageColor:n}=q();return a.jsxs("div",{className:"rtf tool image-upload-container",ref:e,children:[a.jsx("input",{id:"file-input",type:"file",accept:"image/*",onChange:s=>k.handleFileChange(s,r),className:"rtf hidden-file-input"}),a.jsx("label",{htmlFor:"file-input",className:"rtf image-upload-label",children:a.jsx(V,{format:"image",imageColor:n})})]})}),Mt=({onClose:t})=>{const{editor:e,backgroundColor:r}=q(),[n,s]=j.useState(0),[l,c]=j.useState(0),o={backgroundColor:r,color:R(r)?"#FFF":"#000"},p=(w,g)=>{s(w),c(g)},F=(w,g)=>{k.insertTable(e,w+1,g+1),t()},h=()=>{const w=[];for(let g=0;g<5;g++)for(let E=0;E<5;E++){const M=g<=n&&E<=l;w.push(a.jsx("div",{className:`rtf grid-cell ${M?"hovered":""}`,onMouseEnter:()=>p(g,E),onClick:()=>F(g,E)},`${g}-${E}`))}return w};return a.jsxs("div",{style:o,className:"rtf dropdown-menu table-grid-form",children:[a.jsx("div",{className:"rtf grid-container",children:h()}),a.jsxs("div",{style:o,className:"rtf table-size-indicator",children:["Tableau de ",n+1," lignes x ",l+1," colonnes"]})]})},De=j.forwardRef(({allButtons:t,hiddenButtons:e},r)=>{const{editor:n,imageColor:s}=q(),l=k.isSelectionInTable(n),c=[{name:"deleteTable",alt:"Supprimer le tableau",onClick:k.deleteTable},{name:"addRow",alt:"Ajouter une ligne",onClick:k.addRow},{name:"addColumn",alt:"Ajouter une colonne",onClick:k.addColumn},{name:"deleteRow",alt:"Supprimer une ligne",onClick:k.deleteRow},{name:"deleteColumn",alt:"Supprimer une colonne",onClick:k.deleteColumn}];return a.jsx(a.Fragment,{children:c.map((o,p)=>{var F,h;return a.jsx(Q,{text:t.find(w=>w.format===o.name).tooltip,position:"bottom",children:a.jsx("button",{ref:w=>r.current[o.name]=w,className:"rtf tool",style:{display:e.includes(o.name)?"none":"inline-block"},onClick:()=>o.onClick(n),disabled:!l,children:a.jsx(V,{format:o.name,imageColor:l?k.getTableFromSelection(n)?o.name==="addRow"?k.getTableFromSelection(n).children.length>=5?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:o.name==="addColumn"?((F=k.getTableFromSelection(n).children[0])==null?void 0:F.children.length)>=5?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:o.name==="deleteColumn"?((h=k.getTableFromSelection(n).children[0])==null?void 0:h.children.length)===1?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:o.name==="deleteRow"&&k.getTableFromSelection(n).children.length===1?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:s:`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`})})},p)})})}),_t=({activeMarks:t})=>{const[e,r]=j.useState(!1),[n,s]=j.useState([]),l=j.useRef(null),c=j.useRef({}),{editor:o,imageColor:p,backgroundColor:F}=q(),h=[{format:"blockType",tooltip:"Insérer un bloc de texte"},{format:"bold",tooltip:"Gras (Ctrl+B)"},{format:"underline",tooltip:"Souligné (Ctrl+U)"},{format:"italic",tooltip:"Italique (Ctrl+I)"},{format:"strikethrough",tooltip:"Barré"},{format:"subscript",tooltip:"Indice"},{format:"superscript",tooltip:"Exposant"},{format:"blockquote",tooltip:"Citation"},{format:"color",tooltip:"Couleur du texte"},{format:"bgColor",tooltip:"Couleur de fond"},{format:"fontSize",tooltip:"Taille de texte"},{format:"fontFamily",tooltip:"Police d'écriture"},{format:"href",tooltip:"Insérer un lien (Ctrl+K)"},{format:"bulletList",tooltip:"Liste à puces (Ctrl+L)"},{format:"numberedList",tooltip:"Liste à puces (Ctrl+N)"},{format:"left",tooltip:"Gauche"},{format:"center",tooltip:"Centré"},{format:"right",tooltip:"Droite"},{format:"indent",tooltip:"Indenté"},{format:"outdent",tooltip:"Retrait"},{format:"table",tooltip:"Insérer un tableau"},{format:"deleteTable",tooltip:"Supprimer un tableau"},{format:"addRow",tooltip:"Insérer une ligne"},{format:"addColumn",tooltip:"Insérer une colonne"},{format:"deleteRow",tooltip:"Supprimer une ligne"},{format:"deleteColumn",tooltip:"Supprimer une colonne"},{format:"image",tooltip:"Insérer une image"},{format:"code",tooltip:"Bloc de code (Ctrl+E)"},{format:"undo",tooltip:"Annuler (Ctrl+Z)"},{format:"redo",tooltip:"Rétablir (Ctrl+Y)"}],[w,g]=j.useState(!1),E=["deleteTable","addRow","addColumn","deleteRow","deleteColumn"],M=()=>{g(!w)},A=()=>{document.querySelector(".rtf.toolbar").blur()},N=()=>r(i=>!i),L=()=>{if(l.current){const u=l.current.clientWidth-15;if(978>u){let v=0;const y=[];h.forEach(C=>{const x=c.current[C.format];x&&(v+=(C.format==="blockType"?x.clientWidth:25)+5,v<=u&&y.push(C.format))});const f=h.map(C=>C.format).filter(C=>!y.includes(C));s(f)}else s([])}};return j.useEffect(()=>{if(!l.current)return;const i=new ResizeObserver(()=>{L()});return i.observe(l.current),()=>{i.disconnect()}},[]),a.jsxs("div",{className:"rtf toolbar-container",children:[a.jsxs("div",{className:"rtf toolbar",onClick:A,ref:l,children:[a.jsx($t,{ref:i=>c.current.blockType=i,tooltip:h.find(i=>i.format==="blockType").tooltip}),Object.keys(t).map((i,u)=>a.jsx("div",{className:"rtf",ref:b=>c.current[i]=b,style:{display:n.includes(i)?"none":"inline-block"},children:a.jsx(ze,{activeMarks:t,format:i,isActive:t[i],tooltip:h.find(b=>b.format===i).tooltip})},u)),a.jsxs("div",{className:"rtf dropdown tool",style:{display:n.includes("table")?"none":"flex",padding:n.includes("table")?0:5},children:[a.jsx(Q,{text:h.find(i=>i.format==="table").tooltip,position:"bottom",children:a.jsx("button",{ref:i=>c.current.table=i,onClick:M,className:"rtf dropdown-toggle",children:a.jsx(V,{format:"table",imageColor:p})})}),w&&!n.includes("table")&&a.jsx(Mt,{onClose:M})]}),a.jsx(De,{allButtons:h,hiddenButtons:n,ref:c}),!n.includes("image")&&a.jsx(Q,{text:h.find(i=>i.format==="image").tooltip,position:"bottom",children:a.jsx(Oe,{ref:i=>c.current.image=i})}),!n.includes("code")&&a.jsx(Q,{text:h.find(i=>i.format==="code").tooltip,position:"bottom",children:a.jsx(Pe,{ref:i=>c.current.code=i})}),["undo","redo"].map(i=>!n.includes(i)&&a.jsx(Q,{text:h.find(u=>u.format===i).tooltip,position:"bottom",children:a.jsx("button",{ref:u=>c.current[i]=u,className:"rtf tool",style:{display:n.includes(i)?"none":"inline-block"},onMouseDown:u=>{u.preventDefault(),i==="undo"?o.undo():i==="redo"?o.redo():console.error("Type d'action inconnu !")},children:a.jsx(V,{format:i,imageColor:o.history[i+"s"].length===0?`color-mix(in srgb, ${p} 40%, ${R(p)?"white":"black"})`:p})},i)},i)),n.length>0&&a.jsx(Q,{text:"Voir plus",position:"bottom",children:a.jsx("button",{className:"rtf tool toolbar-more-button",onClick:N,children:a.jsx(V,{format:"more",imageColor:p})})})]}),e&&a.jsx("div",{className:"rtf toolbar-modal",style:{backgroundColor:F},onMouseLeave:()=>r(!1),children:n.map(i=>i==="image"||i==="code"||i==="table"||i==="deleteTable"||i==="addRow"||i==="addColumn"||i==="deleteRow"||i==="deleteColumn"?i==="image"?a.jsx(Oe,{ref:u=>c.current.image=u},i):i==="code"?a.jsx(Pe,{ref:u=>c.current.code=u},i):i==="table"?a.jsx("div",{className:"rtf dropdown tool",children:a.jsx(Q,{text:h.find(u=>u.format===i).tooltip,position:"bottom",children:a.jsx("button",{className:"rtf dropdown-toggle",ref:u=>c.current[i]=u,onClick:M,children:a.jsx(V,{format:i,imageColor:p})})},i)}):E.includes(i)?a.jsx(De,{allButtons:h,hiddenButtons:E.filter(u=>u!==i),ref:c},i):null:a.jsx(ze,{activeMarks:t,format:i,isActive:t[i],tooltip:h.find(u=>u.format===i).tooltip},i))})]})};/**
|
|
199
|
+
*/function ve(t){const[e,r]=C.useState(""),[n,s]=C.useState(""),[l,c]=C.useState(!1),[a,p]=C.useState(""),[j,h]=C.useState(""),[w,g]=C.useState("paragraph"),[F,_]=C.useState(!1),[N,S]=C.useState(""),[L,i]=C.useState(!1),u=()=>{i(!L)},b=()=>{_(!F)};return{activeBlock:w,colorMode:n,setColorMode:s,openInNewTab:l,setOpenInNewTab:c,selectedBackgroundColor:j,setSelectedBackgroundColor:h,selectedColor:a,setSelectedColor:p,selectedLanguage:N,setSelectedLanguage:S,selectedLink:e,setSelectedLink:r,showColorPicker:F,showLinkForm:L,setShowLinkForm:i,detectCurrentLanguage:()=>{const{selection:x}=t;if(x){const[T]=d.Editor.nodes(t,{match:A=>A.type==="code"});S(T?T[0].language:null)}},toggleLinkForm:u,toggleColorPicker:b,handleColorChange:x=>{k.applyTextColor(t,x),b()},handleBackgroundColorChange:x=>{k.applyBackgroundTextColor(t,x),b()},handleBlockTypeChange:x=>{k.toggleBlock(t,x),g(x)}}}function At({selectedColor:t,onSelectColor:e,onClose:r}){const[n,s]=C.useState("#ffffff"),{editor:l,backgroundColor:c,borderColor:a,imageColor:p}=q(),j={backgroundColor:c,color:p},h={backgroundColor:`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`,color:R(c)?"#FFF":"#000"},w={backgroundColor:c!=="#6c757d"?"#6c757d":"color-mix(in srgb, #6c757d 30%, black)",color:R(c)?"#FFF":"#000"},g={default:{picker:{background:c,color:p,border:a}}},F=S=>{se.ReactEditor.focus(l),s(S.hex)},_=()=>{n&&(e(n),r())},N=()=>{e(""),r()};return C.useEffect(()=>{t&&s(t)},[t]),o.jsxs("div",{onMouseLeave:r,className:"rtf color-picker-popup",children:[o.jsx(Ue.SketchPicker,{styles:g,color:n,onChangeComplete:F}),o.jsxs("div",{style:j,className:"rtf link-form-actions",children:[o.jsx("button",{className:"rtf",style:h,onClick:_,disabled:!n,children:"Appliquer"}),o.jsx("button",{className:"rtf",style:w,onClick:N,children:"Annuler"})]})]})}const Lt=()=>{const{editor:t,backgroundColor:e,imageColor:r}=q(),n=k.isBlockquoteActive(t);return o.jsx("button",{onMouseDown:s=>{s.preventDefault(),k.toggleBlockquote(t)},style:{backgroundColor:n?`color-mix(in srgb, ${e} 80%, ${R(e)?"white":"black"})`:""},className:"rtf tool",children:o.jsx(V,{format:"blockquote",imageColor:r})})},Q=({text:t,children:e,position:r="top"})=>{var h;const[n,s]=C.useState(!1),{isDarkTheme:l,backgroundDarkColor:c,imageDarkColor:a}=xe(),p=C.Children.count(e),j=C.Children.map(e,w=>w);return o.jsxs("div",{className:"tooltip-container",style:{display:p===1&&((h=j[0].props.style)==null?void 0:h.display)==="none"?"none":"inline-block"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[e,n&&o.jsx("div",{style:{backgroundColor:l?"black":c,color:a,borderColor:a},className:`tooltip tooltip--${r} tooltip--visible`,role:"tooltip","aria-label":t,children:t})]})},ze=({activeMarks:t,format:e,isActive:r,tooltip:n})=>{const[s,l]=C.useState(""),{backgroundColor:c,editor:a,imageColor:p}=q(),{activeBlock:j,colorMode:h,setColorMode:w,openInNewTab:g,detectCurrentLanguage:F,handleColorChange:_,handleBackgroundColorChange:N,setOpenInNewTab:S,selectedBackgroundColor:L,setSelectedBackgroundColor:i,selectedColor:u,setSelectedColor:b,selectedLink:v,setSelectedLink:y,showColorPicker:E,showLinkForm:f,setShowLinkForm:x,toggleColorPicker:T,toggleLinkForm:A}=ve(a),M=j==="h1"||j==="h2",U=["left","center","right"],Z=D=>{k.applyFontSize(a,D)},X=D=>{k.applyFontFamily(a,D),l(D)},I=()=>{setTimeout(()=>se.ReactEditor.focus(a),0)};return C.useEffect(()=>{F();const{selection:D}=a;if(D){const[O]=d.Editor.nodes(a,{match:Y=>Y.type==="link"});O?(S(O[0].target==="_blank"),y(O[0].href)):(S(!1),y(""))}},[a.selection]),o.jsx(Q,{text:n,position:"bottom",children:e==="indent"||e==="outdent"?o.jsx("div",{children:o.jsx("button",{title:n,className:"rtf tool",onClick:()=>e==="indent"?k.handleIndent(a):k.handleOutdent(a),disabled:!r,children:o.jsx(V,{format:e,imageColor:r?p:`color-mix(in srgb, ${p} 40%, black)`})})}):e==="fontSize"?o.jsx(Tt,{disabled:M,onSelectSize:Z,sizeSelected:r}):e==="fontFamily"?o.jsx(St,{fontFamilySelected:s,onSelectFontFamily:X}):e==="bulletList"||e==="numberedList"?o.jsx("div",{className:"rtf dropdown",children:o.jsx(Et,{format:e,isActive:r,onMouseDown:()=>{e=e==="bulletList"?"bullet-list":"numbered-list",k.toggleBlock(a,e)}})}):e==="href"?o.jsxs("div",{className:"rtf dropdown",children:[o.jsx("button",{onMouseDown:D=>{D.preventDefault(),I(),A()},title:n,className:`rtf tool tool--${r?"active":"inactive"}`,children:o.jsx(V,{format:e,imageColor:p})}),f&&o.jsx(Nt,{onClose:()=>x(!1),initialUrl:v,isOpenInNewTab:g})]}):e==="color"||e==="bgColor"?o.jsxs("div",{className:"rtf dropdown",children:[o.jsx("button",{title:n,onMouseDown:D=>{D.preventDefault(),I(),e==="color"?(b(t[e]),w("color"),T()):(i(t[e]),w("bgColor"),T())},className:`rtf tool tool--${r?"active":"inactive"}`,children:o.jsx(V,{format:e,imageColor:p})}),E&&o.jsx(At,{selectedColor:h==="color"?u:L,onSelectColor:h==="color"?_:N,onClose:T})]}):e==="blockquote"?o.jsx(Lt,{tooltip:n}):o.jsx("button",{onMouseDown:D=>{D.preventDefault(),U.includes(e)?k.toggleAlign(a,e):k.toggleMark(a,e)},title:n,style:{backgroundColor:r?`color-mix(in srgb, ${c} 80%, ${R(c)?"white":"black"})`:""},className:"rtf tool",children:o.jsx(V,{format:e,imageColor:p})})})},$t=C.forwardRef(({tooltip:t},e)=>{const{backgroundColor:r,imageColor:n}=q(),{editor:s}=q(),{activeBlock:l,handleBlockTypeChange:c}=ve(s),a=[{type:"paragraph",name:"Paragraphe"},{type:"h1",name:"Titre"},{type:"h2",name:"Sous-titre"}],p={backgroundColor:r,color:n},j=h=>{const w=h.target.value;c(w)};return o.jsx(Q,{text:t,position:"bottom",children:o.jsx("select",{ref:e,className:"rtf",value:l,onChange:j,style:p,children:a.map(h=>o.jsx("option",{className:"rtf",value:h.type,children:h.name},h.type))})})}),Pe=C.forwardRef((t,e)=>{const[r,n]=C.useState(!1),{backgroundColor:s,editor:l,imageColor:c}=q(),{selectedLanguage:a,setSelectedLanguage:p}=ve(l),j={backgroundColor:s,color:c},h={cs:"C#",cpp:"C++",css:"CSS",diff:"Diff",html:"HTML",java:"Java",javascript:"JavaScript",php:"PHP",python:"Python",ruby:"Ruby",typescript:"TypeScript",xml:"XML"},w=()=>{n(!r)},g=F=>{p(F),k.handleCode(l,F),n(!1)};return o.jsxs("div",{ref:e,className:`rtf dropdown tool ${a&&a!=="init"&&a!==""?"tool--active":""}`,children:[o.jsx("button",{className:"rtf dropdown-toggle",onClick:w,children:o.jsx(V,{format:"blockCode",imageColor:c})}),r&&o.jsxs("ul",{style:j,onMouseLeave:w,className:"rtf dropdown-menu",children:[a&&o.jsx("li",{onClick:()=>g("init"),children:"Réinitialiser"}),Object.keys(h).map(F=>o.jsx("li",{onClick:()=>g(F),style:{cursor:"pointer",padding:"5px 10px",backgroundColor:a&&F===a?`color-mix(in srgb, ${s} 80%, ${R(s)?"white":"black"})`:s},children:h[F]},F))]})]})}),Oe=C.forwardRef((t,e)=>{const{editor:r,imageColor:n}=q();return o.jsxs("div",{className:"rtf tool image-upload-container",ref:e,children:[o.jsx("input",{id:"file-input",type:"file",accept:"image/*",onChange:s=>k.handleFileChange(s,r),className:"rtf hidden-file-input"}),o.jsx("label",{htmlFor:"file-input",className:"rtf image-upload-label",children:o.jsx(V,{format:"image",imageColor:n})})]})}),Mt=({onClose:t})=>{const{editor:e,backgroundColor:r}=q(),[n,s]=C.useState(0),[l,c]=C.useState(0),a={backgroundColor:r,color:R(r)?"#FFF":"#000"},p=(w,g)=>{s(w),c(g)},j=(w,g)=>{k.insertTable(e,w+1,g+1),t()},h=()=>{const w=[];for(let g=0;g<5;g++)for(let F=0;F<5;F++){const _=g<=n&&F<=l;w.push(o.jsx("div",{className:`rtf grid-cell ${_?"hovered":""}`,onMouseEnter:()=>p(g,F),onClick:()=>j(g,F)},`${g}-${F}`))}return w};return o.jsxs("div",{style:a,className:"rtf dropdown-menu table-grid-form",children:[o.jsx("div",{className:"rtf grid-container",children:h()}),o.jsxs("div",{style:a,className:"rtf table-size-indicator",children:["Tableau de ",n+1," lignes x ",l+1," colonnes"]})]})},De=C.forwardRef(({allButtons:t,hiddenButtons:e},r)=>{const{editor:n,imageColor:s}=q(),l=k.isSelectionInTable(n),c=[{name:"deleteTable",alt:"Supprimer le tableau",onClick:k.deleteTable},{name:"addRow",alt:"Ajouter une ligne",onClick:k.addRow},{name:"addColumn",alt:"Ajouter une colonne",onClick:k.addColumn},{name:"deleteRow",alt:"Supprimer une ligne",onClick:k.deleteRow},{name:"deleteColumn",alt:"Supprimer une colonne",onClick:k.deleteColumn}];return o.jsx(o.Fragment,{children:c.map((a,p)=>{var j,h;return o.jsx(Q,{text:t.find(w=>w.format===a.name).tooltip,position:"bottom",children:o.jsx("button",{ref:w=>r.current[a.name]=w,className:"rtf tool",style:{display:e.includes(a.name)?"none":"inline-block"},onClick:()=>a.onClick(n),disabled:!l,children:o.jsx(V,{format:a.name,imageColor:l?k.getTableFromSelection(n)?a.name==="addRow"?k.getTableFromSelection(n).children.length>=5?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:a.name==="addColumn"?((j=k.getTableFromSelection(n).children[0])==null?void 0:j.children.length)>=5?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:a.name==="deleteColumn"?((h=k.getTableFromSelection(n).children[0])==null?void 0:h.children.length)===1?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:a.name==="deleteRow"&&k.getTableFromSelection(n).children.length===1?`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`:s:s:`color-mix(in srgb, ${s} 40%, ${R(s)?"white":"black"})`})})},p)})})}),_t=({activeMarks:t})=>{const[e,r]=C.useState(!1),[n,s]=C.useState([]),l=C.useRef(null),c=C.useRef({}),{editor:a,imageColor:p,backgroundColor:j}=q(),h=[{format:"blockType",tooltip:"Insérer un bloc de texte"},{format:"bold",tooltip:"Gras (Ctrl+B)"},{format:"underline",tooltip:"Souligné (Ctrl+U)"},{format:"italic",tooltip:"Italique (Ctrl+I)"},{format:"strikethrough",tooltip:"Barré"},{format:"subscript",tooltip:"Indice"},{format:"superscript",tooltip:"Exposant"},{format:"blockquote",tooltip:"Citation"},{format:"color",tooltip:"Couleur du texte"},{format:"bgColor",tooltip:"Couleur de fond"},{format:"fontSize",tooltip:"Taille de texte"},{format:"fontFamily",tooltip:"Police d'écriture"},{format:"href",tooltip:"Insérer un lien (Ctrl+K)"},{format:"bulletList",tooltip:"Liste à puces (Ctrl+L)"},{format:"numberedList",tooltip:"Liste à puces (Ctrl+N)"},{format:"left",tooltip:"Gauche"},{format:"center",tooltip:"Centré"},{format:"right",tooltip:"Droite"},{format:"indent",tooltip:"Indenté"},{format:"outdent",tooltip:"Retrait"},{format:"table",tooltip:"Insérer un tableau"},{format:"deleteTable",tooltip:"Supprimer un tableau"},{format:"addRow",tooltip:"Insérer une ligne"},{format:"addColumn",tooltip:"Insérer une colonne"},{format:"deleteRow",tooltip:"Supprimer une ligne"},{format:"deleteColumn",tooltip:"Supprimer une colonne"},{format:"image",tooltip:"Insérer une image"},{format:"code",tooltip:"Bloc de code (Ctrl+E)"},{format:"undo",tooltip:"Annuler (Ctrl+Z)"},{format:"redo",tooltip:"Rétablir (Ctrl+Y)"}],[w,g]=C.useState(!1),F=["deleteTable","addRow","addColumn","deleteRow","deleteColumn"],_=()=>{g(!w)},N=()=>{document.querySelector(".rtf.toolbar").blur()},S=()=>r(i=>!i),L=()=>{if(l.current){const u=l.current.clientWidth-15;if(978>u){let v=0;const y=[];h.forEach(f=>{const x=c.current[f.format];x&&(v+=(f.format==="blockType"?x.clientWidth:25)+5,v<=u&&y.push(f.format))});const E=h.map(f=>f.format).filter(f=>!y.includes(f));s(E)}else s([])}};return C.useEffect(()=>{if(!l.current)return;const i=new ResizeObserver(()=>{L()});return i.observe(l.current),()=>{i.disconnect()}},[]),o.jsxs("div",{className:"rtf toolbar-container",children:[o.jsxs("div",{className:"rtf toolbar",onClick:N,ref:l,children:[o.jsx($t,{ref:i=>c.current.blockType=i,tooltip:h.find(i=>i.format==="blockType").tooltip}),Object.keys(t).map((i,u)=>o.jsx("div",{className:"rtf",ref:b=>c.current[i]=b,style:{display:n.includes(i)?"none":"inline-block"},children:o.jsx(ze,{activeMarks:t,format:i,isActive:t[i],tooltip:h.find(b=>b.format===i).tooltip})},u)),o.jsxs("div",{className:"rtf dropdown tool",style:{display:n.includes("table")?"none":"flex",padding:n.includes("table")?0:5},children:[o.jsx(Q,{text:h.find(i=>i.format==="table").tooltip,position:"bottom",children:o.jsx("button",{ref:i=>c.current.table=i,onClick:_,className:"rtf dropdown-toggle",children:o.jsx(V,{format:"table",imageColor:p})})}),w&&!n.includes("table")&&o.jsx(Mt,{onClose:_})]}),o.jsx(De,{allButtons:h,hiddenButtons:n,ref:c}),!n.includes("image")&&o.jsx(Q,{text:h.find(i=>i.format==="image").tooltip,position:"bottom",children:o.jsx(Oe,{ref:i=>c.current.image=i})}),!n.includes("code")&&o.jsx(Q,{text:h.find(i=>i.format==="code").tooltip,position:"bottom",children:o.jsx(Pe,{ref:i=>c.current.code=i})}),["undo","redo"].map(i=>!n.includes(i)&&o.jsx(Q,{text:h.find(u=>u.format===i).tooltip,position:"bottom",children:o.jsx("button",{ref:u=>c.current[i]=u,className:"rtf tool",style:{display:n.includes(i)?"none":"inline-block"},onMouseDown:u=>{u.preventDefault(),i==="undo"?a.undo():i==="redo"?a.redo():console.error("Type d'action inconnu !")},children:o.jsx(V,{format:i,imageColor:a.history[i+"s"].length===0?`color-mix(in srgb, ${p} 40%, ${R(p)?"white":"black"})`:p})},i)},i)),n.length>0&&o.jsx(Q,{text:"Voir plus",position:"bottom",children:o.jsx("button",{className:"rtf tool toolbar-more-button",onClick:S,children:o.jsx(V,{format:"more",imageColor:p})})})]}),e&&o.jsx("div",{className:"rtf toolbar-modal",style:{backgroundColor:j},onMouseLeave:()=>r(!1),children:n.map(i=>i==="image"||i==="code"||i==="table"||i==="deleteTable"||i==="addRow"||i==="addColumn"||i==="deleteRow"||i==="deleteColumn"?i==="image"?o.jsx(Oe,{ref:u=>c.current.image=u},i):i==="code"?o.jsx(Pe,{ref:u=>c.current.code=u},i):i==="table"?o.jsx("div",{className:"rtf dropdown tool",children:o.jsx(Q,{text:h.find(u=>u.format===i).tooltip,position:"bottom",children:o.jsx("button",{className:"rtf dropdown-toggle",ref:u=>c.current[i]=u,onClick:_,children:o.jsx(V,{format:i,imageColor:p})})},i)}):F.includes(i)?o.jsx(De,{allButtons:h,hiddenButtons:F.filter(u=>u!==i),ref:c},i):null:o.jsx(ze,{activeMarks:t,format:i,isActive:t[i],tooltip:h.find(u=>u.format===i).tooltip},i))})]})};/**
|
|
200
200
|
* @license
|
|
201
201
|
* Copyright (c) 2025 Jahylis
|
|
202
202
|
*
|
|
@@ -215,17 +215,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
215
215
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
216
216
|
*
|
|
217
217
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
218
|
-
*/const zt=t=>{const e=n=>{if(n.nodeType===Node.TEXT_NODE){const
|
|
218
|
+
*/const zt=t=>{const e=n=>{if(n.nodeType===Node.TEXT_NODE){const a=n.textContent.trim();return a===""?null:a}if(n.nodeType!==Node.ELEMENT_NODE)return null;const s=Array.from(n.childNodes).map(e).flat().filter(Boolean),l={bold:n.nodeName==="B"||n.nodeName==="STRONG"||n.style.fontWeight==="bold"||n.style.fontWeight==="700",italic:n.nodeName==="I"||n.nodeName==="EM"||n.style.fontStyle==="italic",underline:n.nodeName==="U"||n.style.textDecoration&&n.style.textDecoration.includes("underline"),fontSize:n.style.fontSize||n.nodeName==="FONT"&&n.getAttribute("size"),fontFamily:n.style.fontFamily||n.nodeName==="FONT"&&n.getAttribute("face"),color:n.style.color||n.nodeName==="FONT"&&n.getAttribute("color"),align:n.getAttribute("align")};let c;switch(n.nodeName){case"P":c=P("element",{type:"paragraph",align:l.align,size:l.fontSize},s.length?s:[{text:""}]);break;case"PRE":c=P("element",{type:"code"},s.length?s:[{text:""}]);break;case"UL":c=P("element",{type:"bullet-list"},s);break;case"OL":c=P("element",{type:"numbered-list"},s);break;case"LI":c=P("element",{type:"list-item"},s.length?s:[{text:""}]);break;case"H1":c=P("element",{type:"h1"},s.length?s:[{text:""}]);break;case"H2":case"H3":case"H4":case"H5":case"H6":c=P("element",{type:"h2",align:l.align},s.length?s:[{text:""}]);break;case"BLOCKQUOTE":c=P("element",{type:"blockquote",align:l.align},s.length?s:[{text:""}]);break;case"IMG":c=P("element",{type:"image",url:n.getAttribute("src")});break;case"TABLE":c=P("element",{type:"table"},s);break;case"TR":c=P("element",{type:"table-row"},s);break;case"TD":c=P("element",{type:"table-cell"},s);break;case"A":c=P("element",{type:"link",url:n.getAttribute("href")},s.length?s:[{text:""}]);break;default:c=s.map(a=>typeof a=="string"?P("text",l,a):a).filter(Boolean)}return c};return Array.from(t.childNodes).map(e).flat().filter(Boolean)},Pt=({toggleColor:t,fullScreen:e})=>{const{isDarkTheme:r,toggleTheme:n}=xe();return o.jsxs("label",{className:"rtf toggle-switch",style:{right:e?55:20},children:[o.jsx("input",{className:"rtf",type:"checkbox",checked:r,onChange:n}),o.jsx("span",{className:"rtf slider round",style:{borderColor:t},children:o.jsx("span",{className:"rtf icon",style:{backgroundColor:t},children:o.jsx("span",{children:r?"🌙":"🌞"})})})]})};function Ot({children:t}){const{editor:e,imageColor:r}=q(),n=C.useId(),s=c=>{k.insertParagraphBeforeTable(e,c)},l=()=>{k.insertParagraphAfterTable(e,n)};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"rtf tool table__tool",onClick:()=>s(n),children:o.jsx(V,{format:"enter",imageColor:r})}),o.jsx("table",{className:"rtf","data-table-id":n,children:o.jsx("tbody",{children:t})}),o.jsx("div",{className:"rtf tool table__tool",onClick:l,children:o.jsx(V,{format:"enter",imageColor:r})})]})}const Be=C.createContext({isFullscreen:!1,toggleFullscreen:()=>{}}),Dt=({children:t})=>{const[e,r]=C.useState(!1),n=()=>{r(!e)};return C.useEffect(()=>{const s=()=>{e&&window.innerWidth<768&&r(!1)};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[e]),o.jsx(Be.Provider,{value:{isFullscreen:e,toggleFullscreen:n},children:t})},Re=()=>C.useContext(Be),Bt=({children:t})=>{const{isFullscreen:e}=Re(),r=C.useRef(null);return C.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),o.jsx("div",{ref:r,className:`rtf fullscreen-wrapper ${e?"fullscreen-wrapper--active":""}`,children:t})},Rt=()=>{const{isFullscreen:t,toggleFullscreen:e}=Re(),{backgroundColor:r,imageColor:n}=q();return o.jsx("div",{className:"rtf fullscreen-button",children:o.jsx(Q,{position:"bottom",text:t?"Quitter le mode plein écran (Esc)":"Passer en mode plein écran",children:o.jsx("button",{onClick:e,className:`rtf tool ${t?"tool--active":""}`,style:{backgroundColor:t?`color-mix(in srgb, ${r} 80%, ${R(r)?"white":"black"})`:""},children:o.jsx(V,{format:`fullscreen${t?"Exit":""}`,imageColor:n})})})})};var ye={exports:{}},Ie;function It(){return Ie||(Ie=1,function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
219
219
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
220
220
|
*
|
|
221
221
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
222
222
|
* @author Lea Verou <https://lea.verou.me>
|
|
223
223
|
* @namespace
|
|
224
224
|
* @public
|
|
225
|
-
*/var r=function(n){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,c={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function i(u){return u instanceof p?new p(u.type,i(u.content),u.alias):Array.isArray(u)?u.map(i):u.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(i){return Object.prototype.toString.call(i).slice(8,-1)},objId:function(i){return i.__id||Object.defineProperty(i,"__id",{value:++l}),i.__id},clone:function i(u,b){b=b||{};var v,y;switch(o.util.type(u)){case"Object":if(y=o.util.objId(u),b[y])return b[y];v={},b[y]=v;for(var f in u)u.hasOwnProperty(f)&&(v[f]=i(u[f],b));return v;case"Array":return y=o.util.objId(u),b[y]?b[y]:(v=[],b[y]=v,u.forEach(function(C,x){v[x]=i(C,b)}),v);default:return u}},getLanguage:function(i){for(;i;){var u=s.exec(i.className);if(u)return u[1].toLowerCase();i=i.parentElement}return"none"},setLanguage:function(i,u){i.className=i.className.replace(RegExp(s,"gi"),""),i.classList.add("language-"+u)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(v){var i=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(v.stack)||[])[1];if(i){var u=document.getElementsByTagName("script");for(var b in u)if(u[b].src==i)return u[b]}return null}},isActive:function(i,u,b){for(var v="no-"+u;i;){var y=i.classList;if(y.contains(u))return!0;if(y.contains(v))return!1;i=i.parentElement}return!!b}},languages:{plain:c,plaintext:c,text:c,txt:c,extend:function(i,u){var b=o.util.clone(o.languages[i]);for(var v in u)b[v]=u[v];return b},insertBefore:function(i,u,b,v){v=v||o.languages;var y=v[i],f={};for(var C in y)if(y.hasOwnProperty(C)){if(C==u)for(var x in b)b.hasOwnProperty(x)&&(f[x]=b[x]);b.hasOwnProperty(C)||(f[C]=y[C])}var S=v[i];return v[i]=f,o.languages.DFS(o.languages,function(T,P){P===S&&T!=i&&(this[T]=f)}),f},DFS:function i(u,b,v,y){y=y||{};var f=o.util.objId;for(var C in u)if(u.hasOwnProperty(C)){b.call(u,C,u[C],v||C);var x=u[C],S=o.util.type(x);S==="Object"&&!y[f(x)]?(y[f(x)]=!0,i(x,b,null,y)):S==="Array"&&!y[f(x)]&&(y[f(x)]=!0,i(x,b,C,y))}}},plugins:{},highlightAll:function(i,u){o.highlightAllUnder(document,i,u)},highlightAllUnder:function(i,u,b){var v={callback:b,container:i,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",v),v.elements=Array.prototype.slice.apply(v.container.querySelectorAll(v.selector)),o.hooks.run("before-all-elements-highlight",v);for(var y=0,f;f=v.elements[y++];)o.highlightElement(f,u===!0,v.callback)},highlightElement:function(i,u,b){var v=o.util.getLanguage(i),y=o.languages[v];o.util.setLanguage(i,v);var f=i.parentElement;f&&f.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(f,v);var C=i.textContent,x={element:i,language:v,grammar:y,code:C};function S(P){x.highlightedCode=P,o.hooks.run("before-insert",x),x.element.innerHTML=x.highlightedCode,o.hooks.run("after-highlight",x),o.hooks.run("complete",x),b&&b.call(x.element)}if(o.hooks.run("before-sanity-check",x),f=x.element.parentElement,f&&f.nodeName.toLowerCase()==="pre"&&!f.hasAttribute("tabindex")&&f.setAttribute("tabindex","0"),!x.code){o.hooks.run("complete",x),b&&b.call(x.element);return}if(o.hooks.run("before-highlight",x),!x.grammar){S(o.util.encode(x.code));return}if(u&&n.Worker){var T=new Worker(o.filename);T.onmessage=function(P){S(P.data)},T.postMessage(JSON.stringify({language:x.language,code:x.code,immediateClose:!0}))}else S(o.highlight(x.code,x.grammar,x.language))},highlight:function(i,u,b){var v={code:i,grammar:u,language:b};if(o.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=o.tokenize(v.code,v.grammar),o.hooks.run("after-tokenize",v),p.stringify(o.util.encode(v.tokens),v.language)},tokenize:function(i,u){var b=u.rest;if(b){for(var v in b)u[v]=b[v];delete u.rest}var y=new w;return g(y,y.head,i),h(i,y,u,y.head,0),M(y)},hooks:{all:{},add:function(i,u){var b=o.hooks.all;b[i]=b[i]||[],b[i].push(u)},run:function(i,u){var b=o.hooks.all[i];if(!(!b||!b.length))for(var v=0,y;y=b[v++];)y(u)}},Token:p};n.Prism=o;function p(i,u,b,v){this.type=i,this.content=u,this.alias=b,this.length=(v||"").length|0}p.stringify=function i(u,b){if(typeof u=="string")return u;if(Array.isArray(u)){var v="";return u.forEach(function(S){v+=i(S,b)}),v}var y={type:u.type,content:i(u.content,b),tag:"span",classes:["token",u.type],attributes:{},language:b},f=u.alias;f&&(Array.isArray(f)?Array.prototype.push.apply(y.classes,f):y.classes.push(f)),o.hooks.run("wrap",y);var C="";for(var x in y.attributes)C+=" "+x+'="'+(y.attributes[x]||"").replace(/"/g,""")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+C+">"+y.content+"</"+y.tag+">"};function F(i,u,b,v){i.lastIndex=u;var y=i.exec(b);if(y&&v&&y[1]){var f=y[1].length;y.index+=f,y[0]=y[0].slice(f)}return y}function h(i,u,b,v,y,f){for(var C in b)if(!(!b.hasOwnProperty(C)||!b[C])){var x=b[C];x=Array.isArray(x)?x:[x];for(var S=0;S<x.length;++S){if(f&&f.cause==C+","+S)return;var T=x[S],P=T.inside,K=!!T.lookbehind,U=!!T.greedy,I=T.alias;if(U&&!T.pattern.global){var J=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,J+"g")}for(var D=T.pattern||T,O=v.next,G=y;O!==u.tail&&!(f&&G>=f.reach);G+=O.value.length,O=O.next){var m=O.value;if(u.length>i.length)return;if(!(m instanceof p)){var $=1,_;if(U){if(_=F(D,G,i,K),!_||_.index>=i.length)break;var te=_.index,H=_.index+_[0].length,W=G;for(W+=O.value.length;te>=W;)O=O.next,W+=O.value.length;if(W-=O.value.length,G=W,O.value instanceof p)continue;for(var Z=O;Z!==u.tail&&(W<H||typeof Z.value=="string");Z=Z.next)$++,W+=Z.value.length;$--,m=i.slice(G,W),_.index-=G}else if(_=F(D,0,m,K),!_)continue;var te=_.index,re=_[0],B=m.slice(0,te),ee=m.slice(te+re.length),ne=G+m.length;f&&ne>f.reach&&(f.reach=ne);var oe=O.prev;B&&(oe=g(u,oe,B),G+=B.length),E(u,oe,$);var Wt=new p(C,P?o.tokenize(re,P):re,I,re);if(O=g(u,oe,Wt),ee&&g(u,O,ee),$>1){var we={cause:C+","+S,reach:ne};h(i,u,b,O.prev,G,we),f&&we.reach>f.reach&&(f.reach=we.reach)}}}}}}function w(){var i={value:null,prev:null,next:null},u={value:null,prev:i,next:null};i.next=u,this.head=i,this.tail=u,this.length=0}function g(i,u,b){var v=u.next,y={value:b,prev:u,next:v};return u.next=y,v.prev=y,i.length++,y}function E(i,u,b){for(var v=u.next,y=0;y<b&&v!==i.tail;y++)v=v.next;u.next=v,v.prev=u,i.length-=y}function M(i){for(var u=[],b=i.head.next;b!==i.tail;)u.push(b.value),b=b.next;return u}if(!n.document)return n.addEventListener&&(o.disableWorkerMessageHandler||n.addEventListener("message",function(i){var u=JSON.parse(i.data),b=u.language,v=u.code,y=u.immediateClose;n.postMessage(o.highlight(v,o.languages[b],b)),y&&n.close()},!1)),o;var A=o.util.currentScript();A&&(o.filename=A.src,A.hasAttribute("data-manual")&&(o.manual=!0));function N(){o.manual||o.highlightAll()}if(!o.manual){var L=document.readyState;L==="loading"||L==="interactive"&&A&&A.defer?document.addEventListener("DOMContentLoaded",N):window.requestAnimationFrame?window.requestAnimationFrame(N):window.setTimeout(N,16)}return o}(e);t.exports&&(t.exports=r),typeof Te<"u"&&(Te.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(s,l){var c={};c["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[l]},c.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};o["language-"+l]={pattern:/[\s\S]+/,inside:r.languages[l]};var p={};p[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",p)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(n,s){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:r.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(n){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var l=n.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(typeof r>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading…",s=function(A,N){return"✖ Error "+A+" while fetching file: "+N},l="✖ Error: File does not exist or is empty",c={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",p="loading",F="loaded",h="failed",w="pre[data-src]:not(["+o+'="'+F+'"]):not(['+o+'="'+p+'"])';function g(A,N,L){var i=new XMLHttpRequest;i.open("GET",A,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status<400&&i.responseText?N(i.responseText):i.status>=400?L(s(i.status,i.statusText)):L(l))},i.send(null)}function E(A){var N=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(A||"");if(N){var L=Number(N[1]),i=N[2],u=N[3];return i?u?[L,Number(u)]:[L,void 0]:[L,L]}}r.hooks.add("before-highlightall",function(A){A.selector+=", "+w}),r.hooks.add("before-sanity-check",function(A){var N=A.element;if(N.matches(w)){A.code="",N.setAttribute(o,p);var L=N.appendChild(document.createElement("CODE"));L.textContent=n;var i=N.getAttribute("data-src"),u=A.language;if(u==="none"){var b=(/\.(\w+)$/.exec(i)||[,"none"])[1];u=c[b]||b}r.util.setLanguage(L,u),r.util.setLanguage(N,u);var v=r.plugins.autoloader;v&&v.loadLanguages(u),g(i,function(y){N.setAttribute(o,F);var f=E(N.getAttribute("data-range"));if(f){var C=y.split(/\r\n?|\n/g),x=f[0],S=f[1]==null?C.length:f[1];x<0&&(x+=C.length),x=Math.max(0,Math.min(x-1,C.length)),S<0&&(S+=C.length),S=Math.max(0,Math.min(S,C.length)),y=C.slice(x,S).join(`
|
|
226
|
-
`),N.hasAttribute("data-start")||N.setAttribute("data-start",String(x+1))}L.textContent=y,r.highlightElement(L)},function(y){N.setAttribute(o,h),L.textContent=y})}}),r.plugins.fileHighlight={highlight:function(N){for(var L=(N||document).querySelectorAll(w),i=0,u;u=L[i++];)r.highlightElement(u)}};var M=!1;r.fileHighlight=function(){M||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),M=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(ye)),ye.exports}var Ht=It();const He=pt(Ht);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript;var qe={},Ve;function qt(){return Ve||(Ve=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),qe}qt(),function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(h){return h=h.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var n=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return n}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+l+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+l+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(n),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(w){h!==w&&(t.languages.markdown[h].inside.content.inside[w]=t.languages.markdown[w])})}),t.hooks.add("after-tokenize",function(h){if(h.language!=="markdown"&&h.language!=="md")return;function w(g){if(!(!g||typeof g=="string"))for(var E=0,M=g.length;E<M;E++){var A=g[E];if(A.type!=="code"){w(A.content);continue}var N=A.content[1],L=A.content[3];if(N&&L&&N.type==="code-language"&&L.type==="code-block"&&typeof N.content=="string"){var i=N.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");i=(/[a-z][\w-]*/i.exec(i)||[""])[0].toLowerCase();var u="language-"+i;L.alias?typeof L.alias=="string"?L.alias=[L.alias,u]:L.alias.push(u):L.alias=[u]}}}w(h.tokens)}),t.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var w="",g=0,E=h.classes.length;g<E;g++){var M=h.classes[g],A=/language-(.+)/.exec(M);if(A){w=A[1];break}}var N=t.languages[w];if(N)h.content=t.highlight(F(h.content),N,w);else if(w&&w!=="none"&&t.plugins.autoloader){var L="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);h.attributes.id=L,t.plugins.autoloader.loadLanguages(w,function(){var i=document.getElementById(L);i&&(i.innerHTML=t.highlight(i.textContent,t.languages[w],w))})}}});var c=RegExp(t.languages.markup.tag.pattern.source,"gi"),o={amp:"&",lt:"<",gt:">",quot:'"'},p=String.fromCodePoint||String.fromCharCode;function F(h){var w=h.replace(c,"");return w=w.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,E){if(E=E.toLowerCase(),E[0]==="#"){var M;return E[1]==="x"?M=parseInt(E.slice(2),16):M=Number(E.slice(1)),p(M)}else{var A=o[E];return A||g}}),w}t.languages.md=t.languages.markdown}(Prism),function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism);const Vt=({value:t,setValue:e,fullScreen:r=!0,showTheme:n=!0,borderColor:s="#ccc",backgroundColor:l="#FFF",imageColor:c="#000",borderDarkColor:o="#1A1A1A",backgroundDarkColor:p="#444444",imageDarkColor:F="#ffffff",toggleColor:h="#2584aa",raccourcis:w=null})=>{const[g]=j.useState(()=>Ze.withDocxDeserializer(We.withHistory(se.withReact(d.createEditor())))),[E,M]=j.useState({bold:!1,underline:!1,italic:!1,strikethrough:!1,subscript:!1,superscript:!1,blockquote:!1,color:"",bgColor:"",fontSize:"",fontFamily:"",href:"",bulletList:!1,numberedList:!1,left:!1,center:!1,right:!1,indent:!1,outdent:!1}),A=j.useMemo(()=>t||[{type:"paragraph",children:[{text:"Un exemple de paragraphe."}]}],[]),N=j.useRef([]),L=([f,C])=>{const x=[];if(!d.Element.isElement(f))return x;const S=d.Node.string(f),T=C[0],P=N.current[T];if(P&&P.text==S)return P.ranges;const K=He.tokenize(S,He.languages.javascript);let U=0;for(const I of K){const J=I.length,D=U+J;typeof I!="string"&&x.push({anchor:{path:C,offset:U},focus:{path:C,offset:D},className:`token ${I.type}`}),U=D}return N.current[T]={text:S,ranges:x},x},i=j.useCallback(f=>{switch(f.element.type){case"code":return a.jsx(bt,{...f});case"bullet-list":case"numbered-list":case"list-item":return a.jsx(yt,{...f});case"h1":return a.jsx("h1",{className:"rtf",...f.attributes,children:f.children});case"h2":return a.jsx("h2",{className:"rtf",...f.attributes,children:f.children});case"blockquote":return a.jsx(wt,{...f});case"image":return a.jsx("img",{className:"rtf",src:f.element.url,alt:"",...f.attributes});case"table":return a.jsx(Ot,{...f});case"table-row":return a.jsx("tr",{className:"rtf",children:f.children});case"table-cell":return a.jsx("td",{className:"rtf",children:f.children});default:return a.jsx(xt,{...f})}},[]),u=j.useCallback(f=>a.jsx(vt,{...f}),[]),b=j.useCallback(()=>{const f=d.Editor.marks(g),C=k.isSelectionInList(g);M(x=>{const S={};for(const T in x)if(T==="bulletList"||T==="numberedList"){const P=T==="bulletList"?"bullet-list":T==="numberedList"?"numbered-list":"";S[T]=C&&k.isBlockActive(g,P)}else if(T==="left"||T==="center"||T==="right")S[T]=k.isAlignActive(g,T);else if(T==="indent"||T==="outdent")S[T]=k.canIndent(g,T);else if(T==="href"){const P=k.isLinkActive(g);let K="";if(P){const U=d.Editor.nodes(g,{match:I=>I.type==="link",mode:"highest"});for(const[I]of U)if(I&&I.href){K=I.href;break}K||console.error("No link node with URL property found")}S[T]=K}else T==="color"?S[T]=(f==null?void 0:f.color)||null:T==="fontSize"?S[T]=(f==null?void 0:f.fontSize)||null:S[T]=(f==null?void 0:f[T])===!0;return S})},[g]),v=async f=>{if(k.isSelectionInCode(g)){const x=f.clipboardData.getData("text/plain");x&&(x.includes(`
|
|
227
|
-
`)||
|
|
228
|
-
`)),!!f.ctrlKey)switch(f.key){case"=":{f.preventDefault(),k.toggleBlock(g,"code");break}case"b":{f.preventDefault(),k.toggleMark(g,"bold");break}case"i":{f.preventDefault(),k.toggleMark(g,"italic");break}case"u":{f.preventDefault(),k.toggleMark(g,"underline");break}case"s":{f.preventDefault(),k.toggleMark(g,"strikethrough");break}case"sub":{f.preventDefault(),k.toggleMark(g,"subscript");break}case"sup":{f.preventDefault(),k.toggleMark(g,"superscript");break}case"l":{f.preventDefault(),k.toggleBlock(g,"bulletList");break}case"n":{f.preventDefault(),k.toggleBlock(g,"numberedList");break}case"left":{f.preventDefault(),k.toggleMark(g,"left");break}case"center":{f.preventDefault(),k.toggleMark(g,"center");break}case"right":{f.preventDefault(),k.toggleMark(g,"right");break}case"Enter":{f.preventDefault();const{selection:
|
|
225
|
+
*/var r=function(n){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,c={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function i(u){return u instanceof p?new p(u.type,i(u.content),u.alias):Array.isArray(u)?u.map(i):u.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(i){return Object.prototype.toString.call(i).slice(8,-1)},objId:function(i){return i.__id||Object.defineProperty(i,"__id",{value:++l}),i.__id},clone:function i(u,b){b=b||{};var v,y;switch(a.util.type(u)){case"Object":if(y=a.util.objId(u),b[y])return b[y];v={},b[y]=v;for(var E in u)u.hasOwnProperty(E)&&(v[E]=i(u[E],b));return v;case"Array":return y=a.util.objId(u),b[y]?b[y]:(v=[],b[y]=v,u.forEach(function(f,x){v[x]=i(f,b)}),v);default:return u}},getLanguage:function(i){for(;i;){var u=s.exec(i.className);if(u)return u[1].toLowerCase();i=i.parentElement}return"none"},setLanguage:function(i,u){i.className=i.className.replace(RegExp(s,"gi"),""),i.classList.add("language-"+u)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(v){var i=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(v.stack)||[])[1];if(i){var u=document.getElementsByTagName("script");for(var b in u)if(u[b].src==i)return u[b]}return null}},isActive:function(i,u,b){for(var v="no-"+u;i;){var y=i.classList;if(y.contains(u))return!0;if(y.contains(v))return!1;i=i.parentElement}return!!b}},languages:{plain:c,plaintext:c,text:c,txt:c,extend:function(i,u){var b=a.util.clone(a.languages[i]);for(var v in u)b[v]=u[v];return b},insertBefore:function(i,u,b,v){v=v||a.languages;var y=v[i],E={};for(var f in y)if(y.hasOwnProperty(f)){if(f==u)for(var x in b)b.hasOwnProperty(x)&&(E[x]=b[x]);b.hasOwnProperty(f)||(E[f]=y[f])}var T=v[i];return v[i]=E,a.languages.DFS(a.languages,function(A,M){M===T&&A!=i&&(this[A]=E)}),E},DFS:function i(u,b,v,y){y=y||{};var E=a.util.objId;for(var f in u)if(u.hasOwnProperty(f)){b.call(u,f,u[f],v||f);var x=u[f],T=a.util.type(x);T==="Object"&&!y[E(x)]?(y[E(x)]=!0,i(x,b,null,y)):T==="Array"&&!y[E(x)]&&(y[E(x)]=!0,i(x,b,f,y))}}},plugins:{},highlightAll:function(i,u){a.highlightAllUnder(document,i,u)},highlightAllUnder:function(i,u,b){var v={callback:b,container:i,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",v),v.elements=Array.prototype.slice.apply(v.container.querySelectorAll(v.selector)),a.hooks.run("before-all-elements-highlight",v);for(var y=0,E;E=v.elements[y++];)a.highlightElement(E,u===!0,v.callback)},highlightElement:function(i,u,b){var v=a.util.getLanguage(i),y=a.languages[v];a.util.setLanguage(i,v);var E=i.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,v);var f=i.textContent,x={element:i,language:v,grammar:y,code:f};function T(M){x.highlightedCode=M,a.hooks.run("before-insert",x),x.element.innerHTML=x.highlightedCode,a.hooks.run("after-highlight",x),a.hooks.run("complete",x),b&&b.call(x.element)}if(a.hooks.run("before-sanity-check",x),E=x.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!x.code){a.hooks.run("complete",x),b&&b.call(x.element);return}if(a.hooks.run("before-highlight",x),!x.grammar){T(a.util.encode(x.code));return}if(u&&n.Worker){var A=new Worker(a.filename);A.onmessage=function(M){T(M.data)},A.postMessage(JSON.stringify({language:x.language,code:x.code,immediateClose:!0}))}else T(a.highlight(x.code,x.grammar,x.language))},highlight:function(i,u,b){var v={code:i,grammar:u,language:b};if(a.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=a.tokenize(v.code,v.grammar),a.hooks.run("after-tokenize",v),p.stringify(a.util.encode(v.tokens),v.language)},tokenize:function(i,u){var b=u.rest;if(b){for(var v in b)u[v]=b[v];delete u.rest}var y=new w;return g(y,y.head,i),h(i,y,u,y.head,0),_(y)},hooks:{all:{},add:function(i,u){var b=a.hooks.all;b[i]=b[i]||[],b[i].push(u)},run:function(i,u){var b=a.hooks.all[i];if(!(!b||!b.length))for(var v=0,y;y=b[v++];)y(u)}},Token:p};n.Prism=a;function p(i,u,b,v){this.type=i,this.content=u,this.alias=b,this.length=(v||"").length|0}p.stringify=function i(u,b){if(typeof u=="string")return u;if(Array.isArray(u)){var v="";return u.forEach(function(T){v+=i(T,b)}),v}var y={type:u.type,content:i(u.content,b),tag:"span",classes:["token",u.type],attributes:{},language:b},E=u.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(y.classes,E):y.classes.push(E)),a.hooks.run("wrap",y);var f="";for(var x in y.attributes)f+=" "+x+'="'+(y.attributes[x]||"").replace(/"/g,""")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+f+">"+y.content+"</"+y.tag+">"};function j(i,u,b,v){i.lastIndex=u;var y=i.exec(b);if(y&&v&&y[1]){var E=y[1].length;y.index+=E,y[0]=y[0].slice(E)}return y}function h(i,u,b,v,y,E){for(var f in b)if(!(!b.hasOwnProperty(f)||!b[f])){var x=b[f];x=Array.isArray(x)?x:[x];for(var T=0;T<x.length;++T){if(E&&E.cause==f+","+T)return;var A=x[T],M=A.inside,U=!!A.lookbehind,Z=!!A.greedy,X=A.alias;if(Z&&!A.pattern.global){var I=A.pattern.toString().match(/[imsuy]*$/)[0];A.pattern=RegExp(A.pattern.source,I+"g")}for(var D=A.pattern||A,O=v.next,Y=y;O!==u.tail&&!(E&&Y>=E.reach);Y+=O.value.length,O=O.next){var m=O.value;if(u.length>i.length)return;if(!(m instanceof p)){var $=1,z;if(Z){if(z=j(D,Y,i,U),!z||z.index>=i.length)break;var te=z.index,H=z.index+z[0].length,W=Y;for(W+=O.value.length;te>=W;)O=O.next,W+=O.value.length;if(W-=O.value.length,Y=W,O.value instanceof p)continue;for(var G=O;G!==u.tail&&(W<H||typeof G.value=="string");G=G.next)$++,W+=G.value.length;$--,m=i.slice(Y,W),z.index-=Y}else if(z=j(D,0,m,U),!z)continue;var te=z.index,re=z[0],B=m.slice(0,te),ee=m.slice(te+re.length),ne=Y+m.length;E&&ne>E.reach&&(E.reach=ne);var ae=O.prev;B&&(ae=g(u,ae,B),Y+=B.length),F(u,ae,$);var Wt=new p(f,M?a.tokenize(re,M):re,X,re);if(O=g(u,ae,Wt),ee&&g(u,O,ee),$>1){var we={cause:f+","+T,reach:ne};h(i,u,b,O.prev,Y,we),E&&we.reach>E.reach&&(E.reach=we.reach)}}}}}}function w(){var i={value:null,prev:null,next:null},u={value:null,prev:i,next:null};i.next=u,this.head=i,this.tail=u,this.length=0}function g(i,u,b){var v=u.next,y={value:b,prev:u,next:v};return u.next=y,v.prev=y,i.length++,y}function F(i,u,b){for(var v=u.next,y=0;y<b&&v!==i.tail;y++)v=v.next;u.next=v,v.prev=u,i.length-=y}function _(i){for(var u=[],b=i.head.next;b!==i.tail;)u.push(b.value),b=b.next;return u}if(!n.document)return n.addEventListener&&(a.disableWorkerMessageHandler||n.addEventListener("message",function(i){var u=JSON.parse(i.data),b=u.language,v=u.code,y=u.immediateClose;n.postMessage(a.highlight(v,a.languages[b],b)),y&&n.close()},!1)),a;var N=a.util.currentScript();N&&(a.filename=N.src,N.hasAttribute("data-manual")&&(a.manual=!0));function S(){a.manual||a.highlightAll()}if(!a.manual){var L=document.readyState;L==="loading"||L==="interactive"&&N&&N.defer?document.addEventListener("DOMContentLoaded",S):window.requestAnimationFrame?window.requestAnimationFrame(S):window.setTimeout(S,16)}return a}(e);t.exports&&(t.exports=r),typeof Se<"u"&&(Se.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(s,l){var c={};c["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[l]},c.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};a["language-"+l]={pattern:/[\s\S]+/,inside:r.languages[l]};var p={};p[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:a},r.languages.insertBefore("markup","cdata",p)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(n,s){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:r.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(n){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var l=n.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(typeof r>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading…",s=function(N,S){return"✖ Error "+N+" while fetching file: "+S},l="✖ Error: File does not exist or is empty",c={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",p="loading",j="loaded",h="failed",w="pre[data-src]:not(["+a+'="'+j+'"]):not(['+a+'="'+p+'"])';function g(N,S,L){var i=new XMLHttpRequest;i.open("GET",N,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status<400&&i.responseText?S(i.responseText):i.status>=400?L(s(i.status,i.statusText)):L(l))},i.send(null)}function F(N){var S=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(N||"");if(S){var L=Number(S[1]),i=S[2],u=S[3];return i?u?[L,Number(u)]:[L,void 0]:[L,L]}}r.hooks.add("before-highlightall",function(N){N.selector+=", "+w}),r.hooks.add("before-sanity-check",function(N){var S=N.element;if(S.matches(w)){N.code="",S.setAttribute(a,p);var L=S.appendChild(document.createElement("CODE"));L.textContent=n;var i=S.getAttribute("data-src"),u=N.language;if(u==="none"){var b=(/\.(\w+)$/.exec(i)||[,"none"])[1];u=c[b]||b}r.util.setLanguage(L,u),r.util.setLanguage(S,u);var v=r.plugins.autoloader;v&&v.loadLanguages(u),g(i,function(y){S.setAttribute(a,j);var E=F(S.getAttribute("data-range"));if(E){var f=y.split(/\r\n?|\n/g),x=E[0],T=E[1]==null?f.length:E[1];x<0&&(x+=f.length),x=Math.max(0,Math.min(x-1,f.length)),T<0&&(T+=f.length),T=Math.max(0,Math.min(T,f.length)),y=f.slice(x,T).join(`
|
|
226
|
+
`),S.hasAttribute("data-start")||S.setAttribute("data-start",String(x+1))}L.textContent=y,r.highlightElement(L)},function(y){S.setAttribute(a,h),L.textContent=y})}}),r.plugins.fileHighlight={highlight:function(S){for(var L=(S||document).querySelectorAll(w),i=0,u;u=L[i++];)r.highlightElement(u)}};var _=!1;r.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(ye)),ye.exports}var Ht=It();const He=pt(Ht);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript;var qe={},Ve;function qt(){return Ve||(Ve=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),qe}qt(),function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(h){return h=h.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var n=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return n}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+l+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+l+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(n),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(w){h!==w&&(t.languages.markdown[h].inside.content.inside[w]=t.languages.markdown[w])})}),t.hooks.add("after-tokenize",function(h){if(h.language!=="markdown"&&h.language!=="md")return;function w(g){if(!(!g||typeof g=="string"))for(var F=0,_=g.length;F<_;F++){var N=g[F];if(N.type!=="code"){w(N.content);continue}var S=N.content[1],L=N.content[3];if(S&&L&&S.type==="code-language"&&L.type==="code-block"&&typeof S.content=="string"){var i=S.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");i=(/[a-z][\w-]*/i.exec(i)||[""])[0].toLowerCase();var u="language-"+i;L.alias?typeof L.alias=="string"?L.alias=[L.alias,u]:L.alias.push(u):L.alias=[u]}}}w(h.tokens)}),t.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var w="",g=0,F=h.classes.length;g<F;g++){var _=h.classes[g],N=/language-(.+)/.exec(_);if(N){w=N[1];break}}var S=t.languages[w];if(S)h.content=t.highlight(j(h.content),S,w);else if(w&&w!=="none"&&t.plugins.autoloader){var L="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);h.attributes.id=L,t.plugins.autoloader.loadLanguages(w,function(){var i=document.getElementById(L);i&&(i.innerHTML=t.highlight(i.textContent,t.languages[w],w))})}}});var c=RegExp(t.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},p=String.fromCodePoint||String.fromCharCode;function j(h){var w=h.replace(c,"");return w=w.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,F){if(F=F.toLowerCase(),F[0]==="#"){var _;return F[1]==="x"?_=parseInt(F.slice(2),16):_=Number(F.slice(1)),p(_)}else{var N=a[F];return N||g}}),w}t.languages.md=t.languages.markdown}(Prism),function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(Prism);const Vt=({value:t,setValue:e,fullScreen:r=!0,showTheme:n=!0,borderColor:s="#ccc",backgroundColor:l="#FFF",imageColor:c="#000",borderDarkColor:a="#1A1A1A",backgroundDarkColor:p="#444444",imageDarkColor:j="#ffffff",toggleColor:h="#2584aa",raccourcis:w=null})=>{const[g]=C.useState(()=>Ze.withDocxDeserializer(We.withHistory(se.withReact(d.createEditor())))),[F,_]=C.useState({bold:!1,underline:!1,italic:!1,strikethrough:!1,subscript:!1,superscript:!1,blockquote:!1,color:"",bgColor:"",fontSize:"",fontFamily:"",href:"",bulletList:!1,numberedList:!1,left:!1,center:!1,right:!1,indent:!1,outdent:!1}),N=C.useMemo(()=>t||[{type:"paragraph",children:[{text:""}]}],[]),S=C.useRef([]),L=([f,x])=>{const T=[];if(!d.Element.isElement(f))return T;const A=d.Node.string(f),M=x[0],U=S.current[M];if(U&&U.text==A)return U.ranges;const Z=He.tokenize(A,He.languages.javascript);let X=0;for(const I of Z){const D=I.length,O=X+D;typeof I!="string"&&T.push({anchor:{path:x,offset:X},focus:{path:x,offset:O},className:`token ${I.type}`}),X=O}return S.current[M]={text:A,ranges:T},T},i=C.useCallback(f=>{switch(f.element.type){case"code":return o.jsx(bt,{...f});case"bullet-list":case"numbered-list":case"list-item":return o.jsx(yt,{...f});case"h1":return o.jsx("h1",{className:"rtf",...f.attributes,children:f.children});case"h2":return o.jsx("h2",{className:"rtf",...f.attributes,children:f.children});case"blockquote":return o.jsx(wt,{...f});case"image":return o.jsx("img",{className:"rtf",src:f.element.url,alt:"",...f.attributes});case"table":return o.jsx(Ot,{...f});case"table-row":return o.jsx("tr",{className:"rtf",children:f.children});case"table-cell":return o.jsx("td",{className:"rtf",children:f.children});default:return o.jsx(xt,{...f})}},[]),u=C.useCallback(f=>o.jsx(vt,{...f}),[]),b=C.useCallback(()=>{const f=d.Editor.marks(g),x=k.isSelectionInList(g);_(T=>{const A={};for(const M in T)if(M==="bulletList"||M==="numberedList"){const U=M==="bulletList"?"bullet-list":M==="numberedList"?"numbered-list":"";A[M]=x&&k.isBlockActive(g,U)}else if(M==="left"||M==="center"||M==="right")A[M]=k.isAlignActive(g,M);else if(M==="indent"||M==="outdent")A[M]=k.canIndent(g,M);else if(M==="href"){const U=k.isLinkActive(g);let Z="";if(U){const X=d.Editor.nodes(g,{match:I=>I.type==="link",mode:"highest"});for(const[I]of X)if(I&&I.href){Z=I.href;break}Z||console.error("No link node with URL property found")}A[M]=Z}else M==="color"?A[M]=(f==null?void 0:f.color)||null:M==="fontSize"?A[M]=(f==null?void 0:f.fontSize)||null:A[M]=(f==null?void 0:f[M])===!0;return A})},[g]),v=async f=>{if(k.isSelectionInCode(g)){const T=f.clipboardData.getData("text/plain");T&&(T.includes(`
|
|
227
|
+
`)||T.match(/^\s{2,}/gm))&&(f.preventDefault(),k.insertCodeBlock(g,T));return}const x=f.clipboardData.getData("text/html");if(x){f.preventDefault();const T=new DOMParser().parseFromString(x,"text/html"),A=zt(T.body);g.insertFragment(A)}},y=()=>{d.Transforms.delete(g,{at:{anchor:d.Editor.start(g,[]),focus:d.Editor.end(g,[])}})},E=f=>{f.shiftKey&&k.canIndent(g,"outdent")?(f.preventDefault(),k.handleOutdent(g)):k.canIndent(g,"indent")&&(f.preventDefault(),k.handleIndent(g))};return C.useEffect(()=>{if(w!==null){const f=x=>{Object.keys(w).forEach(T=>{const A=T.split("+"),M=A.pop().toLowerCase(),U=A.map(D=>D.toLowerCase()),Z={ctrl:x.ctrlKey,shift:x.shiftKey,alt:x.altKey,meta:x.metaKey},X=U.every(D=>Z[D]),I=x.key.toLowerCase()===M;X&&I&&w[T](x)})};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}}},[w]),C.useEffect(()=>{t==null&&y()},[t]),o.jsx(kt,{showTheme:n,borderDarkColor:a,backgroundDarkColor:p,imageDarkColor:j,children:o.jsx(Dt,{children:o.jsx(Bt,{children:o.jsx(Ct,{backgroundColor:l,borderColor:s,editor:g,imageColor:c,children:o.jsxs(se.Slate,{editor:g,initialValue:N,value:t,onChange:f=>{if(b(),g.operations.some(T=>T.type!=="set_selection")){const T=JSON.stringify(f);e(f),localStorage.setItem("content",T)}},children:[o.jsx(_t,{activeMarks:F}),o.jsx(se.Editable,{className:"rtf rtf__editor",decorate:L,renderElement:i,renderLeaf:u,style:{borderColor:s,paddingBottom:n||r?35:10},onPaste:v,onKeyDown:f=>{if(f.key==="Tab"){E(f);return}if(f.key==="Enter"&&!f.ctrlKey&&(k.isSelectionInTable(g)||k.isSelectionInCode(g)||k.isBlockquoteActive(g))&&(f.preventDefault(),g.insertText(`
|
|
228
|
+
`)),!!f.ctrlKey)switch(f.key){case"=":{f.preventDefault(),k.toggleBlock(g,"code");break}case"b":{f.preventDefault(),k.toggleMark(g,"bold");break}case"i":{f.preventDefault(),k.toggleMark(g,"italic");break}case"u":{f.preventDefault(),k.toggleMark(g,"underline");break}case"s":{f.preventDefault(),k.toggleMark(g,"strikethrough");break}case"sub":{f.preventDefault(),k.toggleMark(g,"subscript");break}case"sup":{f.preventDefault(),k.toggleMark(g,"superscript");break}case"l":{f.preventDefault(),k.toggleBlock(g,"bulletList");break}case"n":{f.preventDefault(),k.toggleBlock(g,"numberedList");break}case"left":{f.preventDefault(),k.toggleMark(g,"left");break}case"center":{f.preventDefault(),k.toggleMark(g,"center");break}case"right":{f.preventDefault(),k.toggleMark(g,"right");break}case"Enter":{f.preventDefault();const{selection:x}=g;if(x){const[T]=d.Editor.nodes(g,{match:A=>d.Element.isElement(A)&&A.type!=="paragraph"});T&&d.Transforms.insertNodes(g,d.Transforms.insertNodes(g,{type:"paragraph",children:[{text:""}]}))}break}}}}),n&&o.jsx(Pt,{toggleColor:h,fullScreen:r}),r&&o.jsx(Rt,{})]})})})})})};/**
|
|
229
229
|
* @license
|
|
230
230
|
* Copyright (c) 2025 Jahylis
|
|
231
231
|
*
|
|
@@ -244,5 +244,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
244
|
* along with ReactTextForge. If not, see <https://opensource.org/licenses/MIT>.
|
|
245
245
|
*
|
|
246
246
|
* For any questions or suggestions, please contact: administrateur@nhumeria.fr
|
|
247
|
-
*/
|
|
247
|
+
*/K.default=Vt,K.deserialize=ft,K.serialize=J,Object.defineProperties(K,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
248
248
|
//# sourceMappingURL=react-text-forge.umd.cjs.map
|